jmc303


I've been hacking at this problem for a while, and I'm sure tis been doen a thousand times by now by others but I've only just started playing with both PostGIS and MSVE so Its really messing with my head.
Basically we have a several databases full of statistics for geographical locations which could be represented as polylines or polygons and actually both will have to be used... I'm trying to figure out a way of fetching this data from the databases but I want it to remain as polys for future adaptability. I've figured out the code in VE that would select the area and hence the queries I need from PostGIS but I just cant figure out how to join the two things together. I've been pointed at doing some kind of Java servlet and I've had a go at it but cant seem to get it working. I'd appreciate any advice/help offered. Thanks in advance


contact me:
jason dot clarke at calnea dot com



Re: PostGIS, MSVE and alot pf Polylines/Polygons

Derek Chan


There's a useful article here that does what you need in C# about integrating backend database calls up to Virtual Earth:

http://blogs.msdn.com/mappoint_b2b/archive/2005/12/06/500751.aspx







Re: PostGIS, MSVE and alot pf Polylines/Polygons

jmc303

er.. ok but its a good link but so far as Ii can see it doesnt mention how to get the data out of a database, or maybe I'm just being dumb.. probably the latter, but if its there could you quote me a line to help me out
cheers

Jason





Re: PostGIS, MSVE and alot pf Polylines/Polygons

Derek Chan

No your right that article doesn't mention it but grabbing data from database is using ADO.NET / datasets (assuming your developing using .NET Framework).  There isn't anyway to keep your polygon representations inside your database unless you convert it into a readable GeoRSS file format otherwise you will need to break it down into individual lat/longs




Re: PostGIS, MSVE and alot pf Polylines/Polygons

jmc303

I'll look into the .NET side of things.. see if i can get anywhere...
But so far I've been trying Java and XML but havent really achieved anything praiseworthy.. I've managed to get GML out of the databases and I can have that as either LineStrings or Polygons with number of points in a LineString varying from 2 to 299
so what to do with this GML i've seen a blog about KML->GML->Java->Google maps but I just cant follow the Java requests and responses in the html section...
sorry to be such a dunce
cheers
Jason




Re: PostGIS, MSVE and alot pf Polylines/Polygons

bhowden

I have been doing something similar with Oracle Spatial. What I ended up doing was passing in a Select with the appropriate where clause to select a rectangle and then included the convert to well known text function in the Select statement so instead of getting back a spatial object (ie geometry column), I got back a text string with all the coordinates of the polygons. In the .NET world, getstring returned the string with no problem (worked first try).

Brian






Re: PostGIS, MSVE and alot pf Polylines/Polygons

SoulSolutions

Yeah I did something similar in mySQL recently, stored as a 'geometry' data type and used it for seaching like that but then converted it back out as a string of values and then parsed that string to create the actual polygon in VE.

I actually encoded the values on the server and passed only the encoded string across to the client (as it is 25% of the size).

http://www.soulsolutions.com.au/Articles/Encodingforperformance/tabid/96/Default.aspx

John.






Re: PostGIS, MSVE and alot pf Polylines/Polygons

JeffK_

well,

if your used to asp.net 2.0 you could just use the clientcallback feature to get the needed data out of your db,

as csv string or xml,

i prefer csv format over xml,

then you could parse the string and create your polygon from the received data.

thats the way i actually do it.