[postgis-users] Can you call shp2pgsql from a c program ?

strk at refractions.net strk at refractions.net
Thu Nov 18 11:03:30 PST 2004


On Thu, Nov 18, 2004 at 12:01:18PM -0700, Ethan Alpert wrote:
> 
> I'm not a cygwin person but I'm betting you need the absolute path to
> the executable shp2pgsql.
> 
> -e

Also, isn't it shp2pgsql.exe under windows ?
--strk;

> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
> David.Jacques at CCRS.NRCan.gc.ca
> Sent: Thursday, November 18, 2004 11:52 AM
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] Can you call shp2pgsql from a c program ?
> 
> 
> I'm developing some data loading routines in C/C++.
> I'm able to call PQexec() with success for selection, inserting, etc.
> However loading shapefiledata is another question entirely. Is this even
> possible ? Is this a matter of having a mappable cygwin drive visible ?
> 
> I should mention I am using MSVS.NET 7.0 compiler to
> create win32 console apps (using ANSI c/c++ functionality only).
> 
> 
> //get the .shp name from the unzipped file...
> pShapeFileName = GetShapeFileName(pZipFileName);
> 
> //run the shape to postgis conversion program... sprintf(command,
> "shp2pgsql -s 42304 %s xxmfirespots testdb >
> %s.sql\n",pShapeFileName,pShapeFileName);
> system(command);
> 
> 'shp2pgsql' is not recognized as an internal or external
> command,operable program or batch file. shp2pgsql -s 42304
> mire2004323.shp xxmfirespots testdb > mfire2004323shp.sql
> 
> feedback appreciated.
> 
> David Jacques
> _______________________________________________
> postgis-users mailing list postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list