mkalus / segrada

Segrada - Semantic Graph Database
http://www.segrada.org/
Other
68 stars 14 forks source link

Add geographic shapes #44

Open mkalus opened 7 years ago

mkalus commented 7 years ago

Add geographic shapes to maps: lines and polygons.

mkalus commented 3 years ago

Hm, Lucene 5.3 can work with complex shapes, using JTS Topology suite => https://lucene.apache.org/core/5_3_2/spatial/index.html

Question is, can OrientDB integate this? Testing this a bit now...

mkalus commented 3 years ago

Ah, OrientDB can work with spatial stuff starting with version 2.2: http://orientdb.com/docs/2.2.x/Spatial-Index.html

So, this should actually work - uses the JTS stuff with WKT, as I see.

For testing, one can play a bit with collections:

OShapeFactory factory = OShapeFactory.INSTANCE;

        ODocument odoc = factory.toDoc("GEOMETRYCOLLECTION (POINT (40 10), LINESTRING (10 10, 20 20, 10 40), POLYGON ((40 40, 20 45, 45 30, 40 40)))");

        Shape shape = factory.fromText("GEOMETRYCOLLECTION (POINT (40 10), LINESTRING (10 10, 20 20, 10 40), POLYGON ((40 40, 20 45, 45 30, 40 40)))");

        System.out.println(shape);
        System.out.println(odoc);

Question is, how to index collections to OrientDB. OrientDB works with Lucene spatial indexes internally?

Ok, some hints here:

Possible problem:

OrientDB documentation is a bit sparse here, I will need to test a bit...