Are all postgis datatypes in mssqlspatial?

Topics: User Forum
Nov 29, 2006 at 1:20 PM
In postgis after installing it had 324 functions. Are all the same functions, types currently supported in mssqlspatial?

If not could I somehow dump postgis and copy the geometry .dll into sql. I need a way to convert all of postgis onto sql server.
Coordinator
Nov 29, 2006 at 4:18 PM
> In postgis after installing it had 324 functions.
> Are all the same functions, types currently supported in mssqlspatial?

- Just 2D geometry types are supported. PostGIS supports "2.5D"
- Basically all the functions found in the OpenGIS SQL specs plus some goodies "cloned" from PostGIS (eg. "Transform" function, or also PostGIS's lineinterpolatepoint is MsSqlSpatial's ST.LineInterpolatePoint).

> If not could I somehow dump postgis and copy the geometry .dll into sql.

No, they have very different architectures: PostGIS is based on C and Java libraries (GEOS, JTS) and then built together for the specific architecture of PostgreSQL. MsSqlSpatial is enabled by the SQL Server 2005 support of .NET CLR and is currently based on code from SharpMap and NetTopologySuite (a .NET port of JTS) projects. Most of the heavy work is done by those great .NET libraries and the "glue code" is specific to the architecture of SQL CLR integration.

> I need a way to convert all of postgis onto sql server.

Frankly, I doubt you need exactly all of PostGIS. It would be great if you tell us what features you miss after reviewing your PostGIS scripts and check them against the functions found under MsSqlSpatial's "ST" schema.

Best regards,
Ricardo Stuven.
Nov 29, 2006 at 4:38 PM
Thanks for Info. I am hoping we do not need 3d types. So all postgis scripts that only use 2d geom types should in theory run with no modifications in mssqlspatial?
One more unrelated question if i can ask. I get propertyansinulls status not available for user defined function if I choose a funct to modify. Did I just do something dumb like install it wrong?
Coordinator
Dec 1, 2006 at 2:30 AM
> So all postgis scripts that only use 2d geom types
> should in theory run with no modifications in mssqlspatial?

As I said before, that depends on what functions are you using. The basic ones (according to OGC specs) are all implemeted. The rest should be reviewed case by case, but with no big effort you could be running your scripts smoothly...

> I get propertyansinulls status not available for user defined
> function if I choose a funct to modify.
> Did I just do something dumb like install it wrong?

Which function in patticular you want to modify?

Best regards,
Ricardo Stuven.
Dec 1, 2006 at 1:25 PM
Nevermind my questions were me being dumb. I dont need to modify any of those functions. Thanks for all your help. I do have one final question. PostGIS adds a namespace called npgsqltypes that adds intellisense with all the types such as point, poly to C# code. Is there something similiar I can do for mssqlspatial? because I need to use those types from C#.
Thanks.