[OpenLayers-Trac] [OpenLayers] #3313: GeoJSON strings should not include internal feature ids

OpenLayers trac-20090302 at openlayers.org
Mon May 23 09:03:37 EDT 2011


#3313: GeoJSON strings should not include internal feature ids
----------------------------+-----------------------------------------------
 Reporter:  erilem          |       Owner:  tschaub     
     Type:  bug             |      Status:  new         
 Priority:  minor           |   Milestone:  2.12 Release
Component:  Format.GeoJSON  |     Version:  2.10        
 Keywords:                  |       State:              
----------------------------+-----------------------------------------------
 Currently the GeoJSON format does this when serializing a feature:

 {{{
    "id": feature.fid == null ? feature.id : feature.fid,
 }}}

 So if the feature object has no fid, meaning it is not known outside
 !OpenLayers, then we set {{{id}}} to {{{feature.id}}} in the GeoJSON
 string.

 We should not. !OpenLayers internal ids shouldn't be written into the
 GeoJSON string, as it may confuse the server.

 In !MapFish we'd indeed like to determine whether the feature is being
 updated or created, based on whether {{{id}}} is set or not in the GeoJSON
 string. Currently !MapFish considers it is a CREATE operation if the id is
 a string, which is far from ideal.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3313>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list