Implement Spatial data feature.

(2 posts) (2 voices)
  1. ingjgarciad, Member

    Hi team MyDbr.

    It's possible to implement new features by spatial data (geometry, geography) from MS-SQL Server.

    Example
    SQL syntax

    POINT (3 4)
    MULTIPOLYGON(((1 1, 1 -1, -1 -1, -1 1, 1 1)),((1 1, 3 1, 3 3, 1 3, 1 1)))
    LINESTRING(1 1,2 3,4 8, -6 3)
    GEOMETRYCOLLECTION(LINESTRING(1 1, 3 5),POLYGON((-1 -1, -1 -5, -5 -5, -5 -1, -1 -1)))
    CURVEPOLYGON((-122.3 47, 122.3 -47, 125.7 -49, 121 -38, -122.3 47))

    Images

    SQL Managment (Point)

    SQL Managment (Multipolygon)

    MyDBR (Custom SQL with REPLACE, LEFT and RIGHT functions) [Points]

    MyDBR (Custom SQL with REPLACE, LEFT and RIGHT functions) [LineString]*

    *MyDBR suppose a polygon and close them.

    The data of before SQL syntax its similar from function polygon

    'dbr.openstreetmap.polygon - Add polygons to the map'
    but the order is inverse.

    SQL Spatial data is (X,Y) its similar to GeoJson but its separated by space ' ' and delimited by '),('
    OpenStreet & Google Maps API is (Y,X)

    X= Long
    Y = Lat.

    I checked leaflet library #Point but the order is (Y,X) OpenStreet & Google Maps.

    It's dificult make GeoJson from Select Sql-Server but not impossible

    Thanks!!

  2. myDBR Team, Key Master

    What is it that you wish to use the spatial data for? As an overlay on top of a map?

    The easiest solution would be to do a myDBR extension that would get the spatial data from database as WKB and then use a geometry library (like GeoPHP) to do conversions to desired format. The extension could do this while passing the information on. If you need help on this one, let us know.

    Btw, your images are on a private server.
    --
    myDR Team


Reply

You must log in to post.