[Geojson] Features with childs with geometries

Pedro Rodrigo Cardiel prodrig.iaaa at gmail.com
Wed Feb 15 04:38:09 PST 2012


Hello,

I am defining a geojson output for my service and I have a doubt.

I have a list of objects witch have a geometry and they have a list of 
childs with geometry. I have define two way to do this, but I do not 
know what the best way to follow the standard GeoJson:

    { "crs" : { "properties" : { "name" : "urn:ogc:def:crs:EPSG::23030" },
           "type" : "name"
         },
       "error" : false,
       "features" : [ { "geometry" : { "geometries" : [ { "coordinates"
    : [ 672675.71004015696,
                           4613396.96000339
                         ],
                       "type" : "Point",
                       "properties" : {
                             "type" : "parent"
                         },
                     },
                     { "coordinates" : [ 672670.71009521,
                           4613391.9600584405
                         ],
                       "properties" : {
                             "child" :1,
                             "type" : "child"
                         },
                       "type" : "Point"
                     }
                   ],
                 "type" : "GeometryCollection"
               },
             "properties" : {
                 "propertie1" : "value",
                 "propertie2" : "value"
               },
             "type" : "Feature"
           } ],
       "numberOfRecords" : 1,
       "type" : "FeatureCollection"
    }

The other way to do:

    { "crs" : { "properties" : { "name" : "urn:ogc:def:crs:EPSG::23030" },
           "type" : "name"
         },
       "error" : false,
       "features" : [ { "geometry" : { "coordinates" : [
    672675.71004015696, 4613396.96000339],
                                                       "type" : "Point",
                                                       },
                             "properties" : {
                "propertie1" : "value",
                "propertie2" : "value",
    "childs" : [{ "geometry" : { "coordinates" : [ 672675.71004015696,
    4613396.96000339],
                                                                        
               "type" : "Point",
                                                                      
             },
                                                         "properties" : {
                "child" : "1"
              },
                                        "type" : "Feature"
          }]
              },
            "type" : "Feature"
          } ],
       "numberOfRecords" : 1,
       "type" : "FeatureCollection"
    }

You guys can advise me how?

PD: Is there any online json validator?

-- 
-----------------------------------------------------------
Pedro Rodrigo Cardiel
Programador Senior
GeoSLab Logo
     C/ Carlos Marx, 6    CP 50015    Zaragoza (Spain)
     Tlf:   +34 976 762134    +34 976 065152
     Fax: +34 976 106201
prodrig at GeoSLab.com <mailto:prodrig at GeoSLab.com>
http://www.GeoSLab.com
Follow us on Twitter <http://twitter.com/GeoSLab>
------------------------------------------------------------------------
/   Antes de imprimir este correo piensa si realmente es necesario 
hacerlo / Before printing this email, assess if it is really needed /
/    ---- ADVERTENCIA ----
La información contenida en este correo electrónico, y en su caso, 
cualquier fichero anexo al mismo, son de carácter privado y confidencial 
siendo para uso exclusivo de su destinatario. Si usted no es el 
destinatario correcto, el empleado o agente responsable de entregar el 
mensaje al destinatario, o ha recibido esta comunicación por error, le 
informamos que está totalmente prohibida cualquier divulgación, 
distribución o reproducción de esta comunicación según la legislación 
vigente y le rogamos que nos lo notifique inmediatamente, procediendo a 
su destrucción sin continuar su lectura. /
/    ---- WARNING ----
Information contained in this email, and any attached files, are private 
and confidential for the addressee. If you are not the intended 
recipient, employee or agent responsible for delivering this message to 
the addressee, or have received this communication by mistake, please be 
aware that any dissemination, distribution or duplication under current 
laws is forbidden and we request you to notify us immediately and 
destroy the message without continue reading. /
------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geojson.org/pipermail/geojson-geojson.org/attachments/20120215/b47b10cb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GSL_logo.jpg
Type: image/jpeg
Size: 22010 bytes
Desc: not available
URL: <http://lists.geojson.org/pipermail/geojson-geojson.org/attachments/20120215/b47b10cb/attachment.jpg>


More information about the GeoJSON mailing list