Orientdb put Geospatial point on a vertex with Json script

37 views
Skip to first unread message

John

unread,
Jul 26, 2017, 10:10:42 AM7/26/17
to OrientDB

I'am using Orientdb 2.2. I have a CSV with geospatial position I want to make a Graph with geospatial position in the vertex and important it to orient with a Json file.

CSV

0, tag0, 2008-12-9 18:27:4, POINT(6 10)
1, tag1, 2008-7-4 16:43:53, POINT(2 4)
2, tag2, 2004-7-21 16:31:46, POINT(5 7)
3, tag3, 2006-5-26 15:23:27, POINT(10 9)




JSON


"source": { "file": { "path": "/Users/PATH/tag.csv" } },
"extractor": { "csv": {
"separator": ",",
"columns": ["id:Integer","nom:String","date:Datetime","pos:String"] } },
"transformers": [
{ "command": { "command": "create vertex Tag set idTag='${input.id}', nomTag='${input.nom}',dateService='${input.date}',positionTag='${input.pos}'"} }
],

Enrico Risa

unread,
Jul 26, 2017, 10:26:11 AM7/26/17
to orient-...@googlegroups.com
Hi John

since the format of the Point is WKT you can use  ST_GeomFromText function in order to create the Geometry

http://orientdb.com/docs/2.2/Spatial-Index.html#stgeomfromtext

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages