[postgis-users] newbie question: PostGIS and .NET?

Obe, Regina robe.dnd at cityofboston.gov
Wed Jul 16 03:38:46 PDT 2008


Well you could load shape files with SharpMap directly into PostGIS
since it supports both types but you would have to roll your own a bit,
although you can encode the password info etc which you can't with
shp2pgsql. 

SharpMap is more designed for if you already have data in PostGIS and
you want to query it from PostGIS and display it without having to dump
to shape file format first. 

If you just want a shape file to PostGIS loader  - may be easier to just
call shp2pgsql or ogr2ogr using the .NET Process class, which is
described here
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx
.  

I haven't had a need to do that for loading shape files, but I use the
process class for doing xcopy all the time (from one server to another)
 
.NET Process class  would look something like this I imagine -- you may
need to fiddle with security, pemissions etc.  I have never tested this
so not sure what issues would arise or if you can even do a | using
process.  You may need to dump to sql and then load sql file first.
 
   Process.Start("path/to/shp2pgsql", " -s 4269 -I someshapefile
somepgtable | psql -h someserver -d gisdb -U somepguser")

Hope that helps,
Regina
 
 
 

 
 

________________________________

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Saka
Royban
Sent: Wednesday, July 16, 2008 6:16 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] newbie question: PostGIS and .NET?


It means using SharpMap i can load shapfiles to PostGIS, perform the
query and finally have the result in shapefile format? Am i right?
Thanks in advance


----- Original Message ----
From: "Obe, Regina" <robe.dnd at cityofboston.gov>
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>;
postgis-users at postgis.refractions.net
Sent: Tuesday, July 15, 2008 10:10:39 PM
Subject: RE: [postgis-users] newbie question: PostGIS and .NET?


David,
 
Have him take a look at SharpMap.  Its got .NET drivers for PostGIS and
other layer types.
 
http://www.codeplex.com/SharpMap
 
It works for both ASP.NET and windows .net apps.
 
Hope that helps,
Regina
 
 
 
 

________________________________

From: postgis-users-bounces at postgis.refractions.net on behalf of Jean
David TECHER
Sent: Tue 7/15/2008 2:32 PM
To: postgis-users at postgis.refractions.net
Subject: Re: [postgis-users] newbie question: PostGIS and .NET?




Quoting Saka Royban <srph124 at yahoo.com>:

> Hi all.
> Sorry for elementary question. but i didn't find anything to support 
>  PostGIS in .NET environment.
> just some driver for Java.
> I mainly wanna make a desktop GIS applications and it sounds PostGIS 
>  helpful to be used as a back-end to manage large number of  
> shapefiles. So, is there a way to use this spatial database in .NET?
For PostgreSQL you have Npgsql that support PostgreSQL queries


> Queries support by PostGIS are excellent but i need to have export  
> of SQL commands in shapefile.

You have pgsql2shp that could do it! Perhaps need to use API to .net?

> Thanks
>
> saka
>
>
>
>



===================
Jean David TECHER
06 60 46 85 05
04 99 77 17 87
===================

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


________________________________

The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure pursuant
to Massachusetts law. It is intended solely for the addressee. If you
received this in error, please contact the sender and delete the
material from any computer. 

________________________________

Help make the earth a greener place. If at all possible resist printing
this email and join us in saving paper. 


-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.




More information about the postgis-users mailing list