librelist archives

« back to archive

Replacing data through shapefile upload

Replacing data through shapefile upload

From:
Sebastian Benthall
Date:
2010-07-20 @ 18:58
Ariel brought up this issue in channel earlier.  Wanted to recap the
discussion for the list.

Ariel pointed out the following bug: that after uploading new data the layer
page is not accessible anymore.

This raised a couple issues around the "replace data" functionality.

First, what should happen when a user uploads a shapefile that doesn't have
the same typename?    I think the typename should stay the same and the new
filename should be thrown out.

David brought up an additional problem, which is that if the new shapefile
has a substantially different schema, it can break styles that are
associated with that layer.

What's the solution to this bug?

I think that if the way that best short-term solution is to add whatever
error handling is needed for the broken styles to fail gracefully, and let
the user clean up after broken styles as needed.

Do these descriptions match others' expectations?  If so, then I'll make
tickets about them.


---------- Forwarded message ----------
From: GeoNode <ak+trac@openplans.org <ak%2Btrac@openplans.org>>
Date: Tue, Jul 20, 2010 at 12:15 PM
Subject: Re: [GeoNode] #645: Data update view hangs (403)
To:
Cc: dwinslow@opengeo.org, seb@opengeo.org


#645: Data update view hangs (403)
-----------------------------+----------------------------------------------
 Reporter:  ingenieroariel  |            Owner:  ingenieroariel
      Type:  task            |           Status:  closed
  Priority:  major           |        Milestone:  0.1.2.0 Data Management
Foundations
 Component:  Meta            |          Version:
Resolution:  fixed           |         Keywords:
Totalhours:  0               |        Blockedby:
 Sensitive:  0               |   Estimatedhours:  0
 Blocking:                  |
-----------------------------+----------------------------------------------
Changes (by ingenieroariel):

 * status:  new => closed
 * resolution:  => fixed


Comment:

 Fixed in

http://github.com/GeoNode/geonode/commit/ad7bf1e2e66e6953d5c61afc42c0f53a2b42c34b

 Aater fixing that I found out the new data does not get correctly
 configured. But that's material for another ticket / discussion.

--
Ticket URL: <http://projects.opengeo.org/CAPRA/ticket/645#comment:1>
GeoNode <http://geonode.org>
Spatial data infrastructure solution with web GIS and social metadata
features.



-- 
Sebastian Benthall
OpenGeo - http://opengeo.org

Re: [geonode] Replacing data through shapefile upload

From:
David Winslow
Date:
2010-07-20 @ 22:25
On 07/20/2010 02:58 PM, Sebastian Benthall wrote:
> Ariel brought up this issue in channel earlier.  Wanted to recap the 
> discussion for the list.
>
> Ariel pointed out the following bug: that after uploading new data the 
> layer page is not accessible anymore.
>
> This raised a couple issues around the "replace data" functionality.
>
> First, what should happen when a user uploads a shapefile that doesn't 
> have the same typename?    I think the typename should stay the same 
> and the new filename should be thrown out.
Shapefiles don't have typenames.  But, yes, replacing a layer implies 
that the name will not be changing.  Otherwise it's 
"delete-and-upload-something-unrelated" which is probably not what 
anyone is looking for.  So +1 on using the existing typename when a user 
goes through the "replace" form.

> David brought up an additional problem, which is that if the new 
> shapefile has a substantially different schema, it can break styles 
> that are associated with that layer.
"substantial" is vague and misleading here.  The changes are easily 
described and could be automatically detected with a bit of effort.  
Style-breaking changes include -
   * removing attributes
   * changing the type of an existing attribute

If we want, we could even scan known styles and only flag as an error 
changes to attributes that are actually used.

> What's the solution to this bug?
>
> I think that if the way that best short-term solution is to add 
> whatever error handling is needed for the broken styles to fail 
> gracefully, and let the user clean up after broken styles as needed.
-0.5

I don't think that letting GeoNode users unwittingly break *other users' 
maps* is a great way to go.  imo, we should defer the layer replacement 
feature until after the 1.0 release so we have time to implement some 
complementary features to take off some of the rough edges.
> Do these descriptions match others' expectations?  If so, then I'll 
> make tickets about them.

Re: [geonode] Replacing data through shapefile upload

From:
Sebastian Benthall
Date:
2010-07-21 @ 21:16
>
> David brought up an additional problem, which is that if the new shapefile
> has a substantially different schema, it can break styles that are
> associated with that layer.
>
> "substantial" is vague and misleading here.  The changes are easily
> described and could be automatically detected with a bit of effort.
> Style-breaking changes include -
>   * removing attributes
>   * changing the type of an existing attribute
>

Thanks for these details, David.


> If we want, we could even scan known styles and only flag as an error
> changes to attributes that are actually used.
>

What do you think is the best way to go about setting the roadmap for this
sort of thing?

>  What's the solution to this bug?
>
>  I think that if the way that best short-term solution is to add whatever
> error handling is needed for the broken styles to fail gracefully, and let
> the user clean up after broken styles as needed.
>
> -0.5
>
> I don't think that letting GeoNode users unwittingly break *other users'
> maps* is a great way to go.  imo, we should defer the layer replacement
> feature until after the 1.0 release so we have time to implement some
> complementary features to take off some of the rough edges.
>

I disagree with this for two reasons.

First, whenever a map depends on a layer, that is going to involve a
dependency on a resource managed by another person.  There is no way that we
are going to be able to prevent GeoNode users from inadvertently break other
users' maps (users can upload consistent but otherwise bogus data sets; they
can delete their layers, etc.)  I think the only way we can "solve" this
problem is by implementing a much richer system of dependency management
than anyone's anticipated so far (but which could be a cool roadmap item.)

Second, I think that replacing a layer is very important functionality for
this round.  The use case "I have an updated version of this layer; I would
like to make sure people (and maps) have access to the most recent data"
seems like one that would come up a lot if GeoNode were used by an
institution with active GIS work.

If we don't provide the 'Replace this data' feature, then the only other
option available to the users is to delete the old map and upload a new one.
 I think this is a clumsy workflow to impose on people.  Additionally, it
makes it much harder to reuse styling work, because new styles are currently
associated with layers.

Consider:  I upload the data haiti_roads.  Then I spend several hours
developing a complex style.  Then i get an updated version of the data with
the same schema.  If I can replace the data in-place, then no problem.  If I
have to delete and reupload the layer, then I have to recreate the style
because we don't currently support style uploading.  Even if we did add that
to the scope at the last minute, that would mean that this replacing data
workflow would involve the additional steps of download an SLD and
reuploading it.

So, I'm +1 on the layer replacement feature being in 1.0

As for how to deal with the ugliness in the short term, I think it would be
adequate to do the following:
  * Make it so that an informative error message is published in the layer's
tiles when it is requested with an invalid style.
  * Putting a big text warning above the form used for layer replacement
telling people that they should not replace a layer with one with a
different schema or else their styles may fail.

I think it would be great to handle this stuff better in a later milestone.

-- 
Sebastian Benthall
OpenGeo - http://opengeo.org

Re: [geonode] Replacing data through shapefile upload

From:
Gabriel Roldan
Date:
2010-07-21 @ 13:48
Silly idea:
wouldn't it make sense to add a "Type Name" text entry to the data 
upload form?
It could default to the filename (minus .shp) on a first upload, and be 
unmodifiable on an update, besides it would be nice separation of concerns?

2c.
Gabriel

On 7/20/10 7:25 PM, David Winslow wrote:
> On 07/20/2010 02:58 PM, Sebastian Benthall wrote:
>> Ariel brought up this issue in channel earlier. Wanted to recap the
>> discussion for the list.
>>
>> Ariel pointed out the following bug: that after uploading new data the
>> layer page is not accessible anymore.
>>
>> This raised a couple issues around the "replace data" functionality.
>>
>> First, what should happen when a user uploads a shapefile that doesn't
>> have the same typename? I think the typename should stay the same and
>> the new filename should be thrown out.
> Shapefiles don't have typenames. But, yes, replacing a layer implies
> that the name will not be changing. Otherwise it's
> "delete-and-upload-something-unrelated" which is probably not what
> anyone is looking for. So +1 on using the existing typename when a user
> goes through the "replace" form.
>
>> David brought up an additional problem, which is that if the new
>> shapefile has a substantially different schema, it can break styles
>> that are associated with that layer.
> "substantial" is vague and misleading here. The changes are easily
> described and could be automatically detected with a bit of effort.
> Style-breaking changes include -
> * removing attributes
> * changing the type of an existing attribute
>
> If we want, we could even scan known styles and only flag as an error
> changes to attributes that are actually used.
>
>> What's the solution to this bug?
>>
>> I think that if the way that best short-term solution is to add
>> whatever error handling is needed for the broken styles to fail
>> gracefully, and let the user clean up after broken styles as needed.
> -0.5
>
> I don't think that letting GeoNode users unwittingly break *other users'
> maps* is a great way to go. imo, we should defer the layer replacement
> feature until after the 1.0 release so we have time to implement some
> complementary features to take off some of the rough edges.
>> Do these descriptions match others' expectations? If so, then I'll
>> make tickets about them.
>


-- 
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Re: [geonode] Replacing data through shapefile upload

From:
David Winslow
Date:
2010-07-21 @ 14:11
On 07/21/2010 09:48 AM, Gabriel Roldan wrote:
> Silly idea:
> wouldn't it make sense to add a "Type Name" text entry to the data
> upload form?
> It could default to the filename (minus .shp) on a first upload, and be
> unmodifiable on an update, besides it would be nice separation of concerns?
>
> 2c.
> Gabriel
>    

+1
-d

Re: [geonode] Replacing data through shapefile upload

From:
Sebastian Benthall
Date:
2010-07-21 @ 21:21
On Wed, Jul 21, 2010 at 10:11 AM, David Winslow <dwinslow@opengeo.org>wrote:

> On 07/21/2010 09:48 AM, Gabriel Roldan wrote:
> > Silly idea:
> > wouldn't it make sense to add a "Type Name" text entry to the data
> > upload form?
> > It could default to the filename (minus .shp) on a first upload, and be
> > unmodifiable on an update, besides it would be nice separation of
> concerns?
> >
> > 2c.
> > Gabriel
> >
>
> +1
> -d
>

+1

http://projects.opengeo.org/CAPRA/ticket/647

-- 
Sebastian Benthall
OpenGeo - http://opengeo.org

Re: [geonode] Replacing data through shapefile upload

From:
Gabriel Roldan
Date:
2010-07-21 @ 13:51
On 7/21/10 10:48 AM, Gabriel Roldan wrote:
> Silly idea:
> wouldn't it make sense to add a "Type Name" text entry to the data
> upload form?
or rather call it "Layer Name", for user's mind sanity.