asterixdb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Riyafa Abdul Hameed <riy...@apache.org>
Subject Parse GeoJSON data into a record in AsterixDB
Date Wed, 21 Jun 2017 09:26:04 GMT
Hi,

I would like to parse the following or any GeoJSON type[1] to a record in
AsterixDB:
{
   "type":"Feature",
   "geometry":{
      "type":"Point",
      "coordinates":[
         -118.40,
         33.93
      ]
   },
   "properties":{
      "code":"LAX",
      "elevation":38
   }
}

The value of properties is optional and is a variable that is it can be any
type of object. What is the most suitable datatype to use to represent
properties in this case?
Is something like the following possible?

CREATE TYPE GeometryType AS {
     type: string,
     geometry: GeometryType,
     properties: object
};

I came up with the above because there's a derived type called objects[2]
in AsterixDB. The above doesn't work because of the following reasons:

   - type appears to be keyword
   - We can't use the defining type within the same type recursively (ie.
   GeometryType within GeometryType)
   - The type object cannot be resolved

Any suggestions on how a GeoJSON can be parsed into AsterixDB?

[1] https://tools.ietf.org/html/rfc7946
[2]
https://ci.apache.org/projects/asterixdb/datamodel.html#DerivedTypesObject

Thank you
Yours sincerely,
Riyafa

Mime
View raw message