2

I'm trying to use SSIS to transfer point data from a Geography column in SQL Server 2008 R2 to a geometry column in a Greenplum (Postgres 8.2.15) database with PostGIS. I know there's a way to do the conversion outside of SSIS because I did it once a while back, unfortunately I don't remember what I did.

1
  • 1
    I think I'm on the right track. I can use a query for the input that converts to POINT text using geometry::STGeomFromWKB(myPointColumn.STAsBinary(), myPointColumn.STSrid).STAsText(). Then I won't need a data transformation at all.
    – influent
    Nov 9 '12 at 21:01
2

I figured it out. I used a query for the SQL Server source that converts to POINT text using:

geometry::STGeomFromWKB(myPointColumn.STAsBinary(), myPointColumn.STSrid).STAsText()

That was all it took. Now whether the point will be represented in PostGIS the way I intend it to I can't say at this point, but I'm hoping so.

1

You could use ogr2ogr.
I'm not certain if you can do a direct import, but at the very least you can export to a SHP file, and then import the SHP file to PostGIS with shp2pgsql. It ships with PostGIS. b

2

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .