Debugging some JSON in the GIS module

We have for various reasons, needed to import coordinate data directly into the database, but are having some issues displaying it in the GIS client.

Here is the response, which is giving issues. See below.

Here is the response.

http://pastebin.com/03qxrTEs

Any help would be appreciated.

Best regards,

Jason

  1. Uncaught TypeError: Cannot read property ‘length’ of null core.js:2271

  2. util.map.getTransformedFeatureArraycore.js:2271

  3. Ext.data.JsonP.request.successcore.js:1458

  4. Ext.apply.callbackext-all.js:15

  5. Ext.define.handleResponseext-all.js:15

  6. (anonymous function)ext-all.js:15

  7. (anonymous function)getGeoJson.action?ids=LEVEL-4&ids=AWn3s2RqgAN&callback=Ext.data.JsonP.callback3:1

These are polygons. Just add another “[” and “]” to the coordinates to make them multi-polygons and it will work.

···

On Tue, Jun 10, 2014 at 5:11 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

We have for various reasons, needed to import coordinate data directly into the database, but are having some issues displaying it in the GIS client.

Here is the response, which is giving issues. See below.

Here is the response.

http://pastebin.com/03qxrTEs

Any help would be appreciated.

Best regards,

Jason

  1. Uncaught TypeError: Cannot read property ‘length’ of null core.js:2271
  2. util.map.getTransformedFeatureArraycore.js:2271
  1. Ext.data.JsonP.request.successcore.js:1458
  1. Ext.apply.callbackext-all.js:15
  1. Ext.define.handleResponseext-all.js:15
  1. (anonymous function)ext-all.js:15
  1. (anonymous function)getGeoJson.action?ids=LEVEL-4&ids=AWn3s2RqgAN&callback=Ext.data.JsonP.callback3:1

Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Thanks Jan. That worked perfectly. I should have remembered this from before, as I think you have answered the same question before. :slight_smile:

Regards,

Jason

···

On Tue, Jun 10, 2014 at 5:20 PM, Jan Henrik Øverland janhenrik.overland@gmail.com wrote:

These are polygons. Just add another “[” and “]” to the coordinates to make them multi-polygons and it will work.

On Tue, Jun 10, 2014 at 5:11 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

We have for various reasons, needed to import coordinate data directly into the database, but are having some issues displaying it in the GIS client.

Here is the response, which is giving issues. See below.

Here is the response.

http://pastebin.com/03qxrTEs

Any help would be appreciated.

Best regards,

Jason

  1. Uncaught TypeError: Cannot read property ‘length’ of null core.js:2271
  2. util.map.getTransformedFeatureArraycore.js:2271
  1. Ext.data.JsonP.request.successcore.js:1458
  1. Ext.apply.callbackext-all.js:15
  1. Ext.define.handleResponseext-all.js:15
  1. (anonymous function)ext-all.js:15
  1. (anonymous function)getGeoJson.action?ids=LEVEL-4&ids=AWn3s2RqgAN&callback=Ext.data.JsonP.callback3:1

Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

The GML importer inserts “Polygon” into the “featuretype” field though, so it is not obvious. Should ideally be changed. The GIS app accepts both “Polygon” and “MultiPolygon”.

···

On Tue, Jun 10, 2014 at 5:39 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Thanks Jan. That worked perfectly. I should have remembered this from before, as I think you have answered the same question before. :slight_smile:

Regards,

Jason

On Tue, Jun 10, 2014 at 5:20 PM, Jan Henrik Øverland janhenrik.overland@gmail.com wrote:

These are polygons. Just add another “[” and “]” to the coordinates to make them multi-polygons and it will work.

On Tue, Jun 10, 2014 at 5:11 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

We have for various reasons, needed to import coordinate data directly into the database, but are having some issues displaying it in the GIS client.

Here is the response, which is giving issues. See below.

Here is the response.

http://pastebin.com/03qxrTEs

Any help would be appreciated.

Best regards,

Jason

  1. Uncaught TypeError: Cannot read property ‘length’ of null core.js:2271
  2. util.map.getTransformedFeatureArraycore.js:2271
  1. Ext.data.JsonP.request.successcore.js:1458
  1. Ext.apply.callbackext-all.js:15
  1. Ext.define.handleResponseext-all.js:15
  1. (anonymous function)ext-all.js:15
  1. (anonymous function)getGeoJson.action?ids=LEVEL-4&ids=AWn3s2RqgAN&callback=Ext.data.JsonP.callback3:1

Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Yeah, well, I did not use the GML importer, because my geodata has non-unique names, and there is currently no way (which I know of) to get around this. So, I created SQL and imported this directly into the system. Postgresql claims the FeatureType is already “Polygon”, so it seems a bit strange that I would need to coerce the Polygons to MultiPolygons to get it to work?

Regards,

Jason

···

On Tue, Jun 10, 2014 at 5:46 PM, Jan Henrik Øverland janhenrik.overland@gmail.com wrote:

The GML importer inserts “Polygon” into the “featuretype” field though, so it is not obvious. Should ideally be changed. The GIS app accepts both “Polygon” and “MultiPolygon”.

On Tue, Jun 10, 2014 at 5:39 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Thanks Jan. That worked perfectly. I should have remembered this from before, as I think you have answered the same question before. :slight_smile:

Regards,

Jason

On Tue, Jun 10, 2014 at 5:20 PM, Jan Henrik Øverland janhenrik.overland@gmail.com wrote:

These are polygons. Just add another “[” and “]” to the coordinates to make them multi-polygons and it will work.

On Tue, Jun 10, 2014 at 5:11 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

We have for various reasons, needed to import coordinate data directly into the database, but are having some issues displaying it in the GIS client.

Here is the response, which is giving issues. See below.

Here is the response.

http://pastebin.com/03qxrTEs

Any help would be appreciated.

Best regards,

Jason

  1. Uncaught TypeError: Cannot read property ‘length’ of null core.js:2271
  2. util.map.getTransformedFeatureArraycore.js:2271
  1. Ext.data.JsonP.request.successcore.js:1458
  1. Ext.apply.callbackext-all.js:15
  1. Ext.define.handleResponseext-all.js:15
  1. (anonymous function)ext-all.js:15
  1. (anonymous function)getGeoJson.action?ids=LEVEL-4&ids=AWn3s2RqgAN&callback=Ext.data.JsonP.callback3:1

Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

We decided back in the day that we only wanted to deal with points and multipolygons, so the GML importer accepts both polygon and MP coordinates but converts polygon coordinates to MP coordinates before inserting it in the db. The GIS app is relying on this and supports points and MP coordinates only (though both “Polygon” and “MultiPolygon” as featuretype). Which admittedly is not very alternative-importation friendly.

···

On Tue, Jun 10, 2014 at 5:49 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Yeah, well, I did not use the GML importer, because my geodata has non-unique names, and there is currently no way (which I know of) to get around this. So, I created SQL and imported this directly into the system. Postgresql claims the FeatureType is already “Polygon”, so it seems a bit strange that I would need to coerce the Polygons to MultiPolygons to get it to work?

Regards,

Jason

On Tue, Jun 10, 2014 at 5:46 PM, Jan Henrik Øverland janhenrik.overland@gmail.com wrote:

The GML importer inserts “Polygon” into the “featuretype” field though, so it is not obvious. Should ideally be changed. The GIS app accepts both “Polygon” and “MultiPolygon”.

On Tue, Jun 10, 2014 at 5:39 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

Thanks Jan. That worked perfectly. I should have remembered this from before, as I think you have answered the same question before. :slight_smile:

Regards,

Jason

On Tue, Jun 10, 2014 at 5:20 PM, Jan Henrik Øverland janhenrik.overland@gmail.com wrote:

These are polygons. Just add another “[” and “]” to the coordinates to make them multi-polygons and it will work.

On Tue, Jun 10, 2014 at 5:11 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

We have for various reasons, needed to import coordinate data directly into the database, but are having some issues displaying it in the GIS client.

Here is the response, which is giving issues. See below.

Here is the response.

http://pastebin.com/03qxrTEs

Any help would be appreciated.

Best regards,

Jason

  1. Uncaught TypeError: Cannot read property ‘length’ of null core.js:2271
  2. util.map.getTransformedFeatureArraycore.js:2271
  1. Ext.data.JsonP.request.successcore.js:1458
  1. Ext.apply.callbackext-all.js:15
  1. Ext.define.handleResponseext-all.js:15
  1. (anonymous function)ext-all.js:15
  1. (anonymous function)getGeoJson.action?ids=LEVEL-4&ids=AWn3s2RqgAN&callback=Ext.data.JsonP.callback3:1

Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp