Ticket #2454 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

Format.GeoJSON multipolygon parsing

Reported by: jmcgrath Owned by: jmcgrath
Priority: minor Milestone:
Component: Format.GeoJSON Version:
Keywords: parsing, geojson, multipolygon Cc:
State:

Description

Multipolygons are treated as having 3d coordinates since a 3 dimensional array is passed to the polygon function.

Fixed by changing :

p = this.parseCoords["polygon"].apply(this, [array[i]]);

to

p = this.parseCoords["polygon"].apply(this, array[i]);

Attachments

patch_geojson.diff Download (0.5 KB) - added by jmcgrath 3 years ago.
Multipolygon

Change History

Changed 3 years ago by jmcgrath

Multipolygon

Changed 3 years ago by elemoine

  • status changed from new to closed
  • resolution set to invalid

This ticket looks invalid to me. The test_Format_GeoJSON_multipol unit test shows that we corrently parse MultiPolygons.

Please reopen this ticket if I'm overseeing something here.

Changed 3 years ago by jmcgrath

  • status changed from closed to reopened
  • resolution invalid deleted

By using the following test :

OpenLayers.Format.GeoJSON.prototype.read({"geometry": {"type": "MultiPolygon", "coordinates": [[[152247.2156, 5431099.0499], [151437.4204, 5430512.3931999998], [151389.09349999999, 5430581.3699000003], [151393.25889999999, 5430661.2876000004], [151381.43909999999, 5430716.8130000001], [151377.9418, 5430754.9866000004], [151372.1845, 5430783.4693999998], [151929.6306, 5431188.6385000004], [152904.59839999999, 5431896.8369000005], [152915.9976, 5431881.3754000003], [153056.40049999999, 5431685.6265000002], [152354.59229999999, 5431176.8373999996], [152247.2156, 5431099.0499]], [[151352.174, 5430634.8849999998], [151352.14110000001, 5430634.125], [151292.448, 5430719.3332000002], [151291.52420000001, 5430721.3733999999], [151289.61050000001, 5430723.4535999997], [151352.4792, 5430769.1380000003], [151352.07509999999, 5430759.017], [151350.65640000001, 5430723.0335999997], [151353.23809999999, 5430661.8676000005], [151352.174, 5430634.8849999998]]]}, "type": "Feature", "id": 25, "properties": {"keyx": "12345", "keyy": "1234456", "keyz": "1234556", "nom_mun": "1234567890"}});

I get "null" with [array[i]] and I get a valid Object with array[i].

The example I used was returned by a FeatureServer request.

Changed 3 years ago by crschmidt

  • status changed from reopened to closed
  • resolution set to invalid

What you have given is a bug in FeatureServer. Please feel free to file a ticket at  http://trac.osgeo.org/featureserver/ .

Note: See TracTickets for help on using tickets.