Quansight / omnisci

Explorations on using MapD and Jupyter together.
4 stars 1 forks source link

Add Ibis support for geospatial data types and functions #21

Closed xmnlab closed 5 years ago

xmnlab commented 5 years ago

Geospatial Primitive Types

POINT:

LINESTRING:

POLYGON:

MULTIPOLYGON:

OmniSci supports SRIDs 4326 and 900913. You can specify the SRID of your geometry field when creating the table:

If you did not set the SRID of your geo field in the table, you need to set it in your SQL code. The following query uses ST _DISTANCE, sets the SRID to 4326, and casts the geospatial point field as a geography to return the distance in meters:

Geospatial Literals

Geospatial functions that expect geospatial object arguments accept geospatial columns, geospatial objects returned by other functions, or string literals containing WKT representations of geospatial objects. Supplying a WKT string is equivalent to calling a geometry constructor. For example, these two queries are identical:

SELECT count() from geo1 where ST_Distance(p1, ‘POINT(1 2)’) < 1.0; SELECT count() from geo1 where ST_Distance(p1, ST_GeomFromText(‘POINT(1 2)’));

Geospatial functions

References

xmnlab commented 5 years ago

the missing 3 features will be addressed in a new issue.