[postgis-users] PostGIS and ADO.NET

Obe, Regina robe.dnd at cityofboston.gov
Thu Apr 26 01:12:43 PDT 2007


Oops wrong sharpmap tutorial
 
http://www.bostongis.com/?content_name=postgis_sharpmap_tut02

________________________________

From: postgis-users-bounces at postgis.refractions.net on behalf of Obe, Regina
Sent: Thu 4/26/2007 4:05 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] PostGIS and ADO.NET


Jeff,
 
Just wanted to add to what Abe was saying.  Its not entirely true that you have to convert to byte array to use except for updating data.
 
SharpMap and ZigGIS do that already for you I think so you can just focus on writing the SQL statements.  Not sure about NetTopologySuite.
 
It depends on what you are trying to do I guess.  I've used PostGIS in ..NET 2.0 and .NET 1.1. in a number of ways.
 
1) With SharpMap - you may want to look at the PostGIS driver they have developed to see how the byte array type thing that Abe mentioned is done.  There's is a native driver so only piggy backs on the Npgsql PostgreSQL .NET driver.  I have a quick example on my site on how to use it.  Although it might have changed since I wrote it
http://www.bostongis.com/?content_name=postgis_sharpmap_tut01
 
 
2) Using Mapserver Mapscript - you can play with layers directly from Vb.NET or C#.  Paolo has a nice tutorial on how this is done.    
http://www.paolocorti.net/public/wordpress/index.php/2006/09/20/mapserver-tutorial-for-c-mapscript-asp-net/
 
3)
Note Paolo also has some nice tutorials on using ZigGIS.  ZigGIS is strictly an ArcGIS driver so you can only use it in conjunction with ArcGIS.
http://www.paolocorti.net/public/wordpress/index.php/2007/02/14/installing-ziggis-11-for-connecting-arcmap-to-postgis-layers/
 
 
4)  Mapserver CGI where I have Mapserver query PostGIS and provide a WMS, WFS interface and then query the WMS, WFS interface using  OpenLayers which I then overlay with data from Google Maps, Virtual Earth etc.  OpenLayers is a javascript api but has a number of interfaces for various Map services.  I personally think its pretty neat.  Unfortunately I don't have any really good tutorials on this - I was going to write some up on the new Openlayers 2.4 tutorial (which I think supports updating data via WFS-T interfaces, a KML driver, a GML driver)  and setting up Mapserver as a WFS, WMS service.  But sadly I've been swamped so haven't had a chance to write these down.  Long on ideas - short on time.
 
Here is just a general OpenLayers tutorial
http://www.bostongis.com/?content_name=openlayers_tut_01
 
http://www.openlayers.org  the download file has some handy examples as well.
 
5) You can publish PostGIS data with Geoserver (along with other datasources by the way) as well to provide a WMS, WFS, WFS-T interface and then query or update data with that with anything that supports those interfaces.  I haven't done that, but I know MassGIS publishes their ArcSDE data using Geoserver and if you want to update data via WFS-T may be something to take a look at. GeoServer I think uses java servlets so may not be an option for you if you are a strictly ..NET/Windows shop.
http://www.geoserver.org
 
 
6) Then PostGIS has functions such as AsGML, AsKML, AsSVG which you can use to render these kind of formats that can then be used in such things as GoogleEarth or other interfaces that support these.  I was going to write up some examples on this too in how to use this in .NET and PHP but - yah time is non-existent at the moment.
 
Hope that helps,
Regina
 
 

________________________________

From: postgis-users-bounces at postgis.refractions.net on behalf of Abe Gillespie
Sent: Wed 4/25/2007 6:52 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] PostGIS and ADO.NET



Hello Jeff,

There is no *direct* support per se (at least none that I know of).
But you can use Npgsql as the ADO.NET data access driver and retrieve
the shape data as byte arrays.  To get instantiated shape objects
you'll then have to feed the byte array into libraries such as
NetTopolgySuite (http://nts.sourceforge.net/), SharpMap
(http://www.codeplex.com/SharpMap/), or consume the byte arrays
directly in your code as is done in zigGIS
(http://code.google.com/p/ziggis/).

You'll have to write your SQL spatial queries by hand.  But I suspect
you'll want to do this anyway.

Good luck!

--
Abe Gillespie, abe at digital-pulp.com
Programmer for hire - GIS, Business Apps, Website Apps
http://code.google.com/p/ziggis/

On 4/25/07, Jeff Dege <jdege at korterra.com> wrote:
> I've done some web browsing, trying to find current information on how
> well PostGIS integrates with ADO.NET, and while I've found a number of
> discussions, none really seemed to answer.
>
> Are there current ADO.NET 2.0 drivers for PostGIS?  Are there current
> drivers for PostSQL?  If only the latter exist, how does that limit what
> I can do with PostGIS?
>
> _______________________________________________
> 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


________________________________

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. 



-----------------------------------------
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070426/014a4957/attachment.html>


More information about the postgis-users mailing list