[mapserver-users] mapserver CGI GeoJSON output

Li Quansheng quansheng.cs at gmail.com
Wed Apr 18 04:31:04 EDT 2012


hi Steve,guys
I really don't know where the  coordinates  are truncated or not. In facct,
I couldn't find the reason cause the output problem.
the output is as flowings:
{
"type": "FeatureCollection",
"features": [
  {
    "type": "Feature",
    "id": "1",
    "geometry": {
      "type": "MultiLineString",
      "coordinates": [
                      "coordinates": [[84,42 84,42 84,42 84,42 83,42 83,42
83,42 83,42
83,42 83,42]]
      ]
    },
    "properties": {
      "gid": "1",
      "type": "70",
      "name": "name111"
    }
  },
...
{
     "type": "Feature",
     "id": "3",
     "geometry": {
       "type": "MultiLineString",
       "coordinates": [
"coordinates": [[83,42 83,42 83,42 83,42 83,42]]
       ]
     },
     "properties": {
       "gid": "3",
       "type": "70",
       "name": "name333"
     }
   },
 ....
........
      ]
}
But I exectue the SQL from pgAdmin III,select
gid,type,ST_AsGeoJSON(the_geom) from tielu

IN pgAdmin I output the SQL so you can see the output exactely,
{"type":"MultiLineString","coordinates":[[[83.981538,41.839139000000003],[83.945753999999994,41.838410000000003],[83.916893000000002,41.834904999999999],[83.687324000000004,41.810006000000001],[83.232517999999999,41.753878999999998],[83.223220999999995,41.752234000000001],[83.221637999999999,41.750559000000003],[83.216065999999998,41.741002999999999],[83.144756999999998,41.724834000000001],[83.030783,41.697861000000003]]]}
{"type":"MultiLineString","coordinates":[[[83.022717,41.695501999999998],[83.022499999999994,41.695433000000001],[83.007728999999998,41.691218999999997]]]}
{"type":"MultiLineString","coordinates":[[[83.030783,41.697861000000003],[83.029948000000005,41.697662999999999],[83.028228999999996,41.697189000000002],[83.025898999999995,41.696514000000001],[83.022717,41.695501999999998]]]}
.....
.....
If  there is nothing wrong with  my template file xj1JSON.tmpl, the
"coordinates"  of  GeoJSON  output should match with the
ST_AsGeoJSON(the_geom).I have no clue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120418/a0f90d8d/attachment.html


More information about the mapserver-users mailing list