Re: [mapserver-users] Finding the centroid given the feature

2009-06-02 Thread Varun saraf
Center of the geometry works perfect. I need to get access to any point inside the polygon feature. I believe I can use an itemQuery on mapserver to query the attribute but how does mapserver return the center point? Do I need to create an HTML template for that too? On Mon, Jun 1, 2009 at 4:11

Re: [mapserver-users] Finding the centroid given the feature

2009-06-02 Thread Steve Lime
Yes, you'd need to create a template for that. You could return JSON, XML, csv or whatever. This would be the most straightfoward using 5.2 or ideally 5.4.1 (due out today) and the new style templates. You could create a template output format to use like so: OUTPUTFORMAT NAME 'geom_center'

Re: [mapserver-users] Finding the centroid given the feature

2009-06-02 Thread Varun saraf
Thanks a lot Steve. I am able to use the itemquery to fetch the other attributes correctly but somehow, the center of polygon isn't working right. Its returning to me, the co-ordinates that are outside the bounds of the mapping application. All my data is in the actual geographic co-ordinate

Re: [mapserver-users] Finding the centroid given the feature

2009-06-02 Thread Varun saraf
I had my mapfile extent changed and it worked Perfect. Thanks a lot Steve. It was a great help! On Tue, Jun 2, 2009 at 4:16 PM, Varun saraf vsaraf@gmail.com wrote: Thanks a lot Steve. I am able to use the itemquery to fetch the other attributes correctly but somehow, the center of polygon

Re: [mapserver-users] Finding the centroid given the feature

2009-06-01 Thread Steve Lime
MapServer templates can produce a center point for a geometry but it's not a true centroid but those aren't guaranteed to be in the polygon. MapScript could be used as well I suppose. In either case you'd send a lookup request to the CGI or MapScript, do an attribute query and return whatever

Re: [mapserver-users] Finding the centroid given the feature

2009-05-29 Thread Varun saraf
I am using mapserver 5.0 with google maps and the data source is the US Census tracts as shape files and dbf files. On Thu, May 28, 2009 at 2:12 PM, Steve Lime steve.l...@dnr.state.mn.us wrote: What version are you using? What data source? Steve On 5/28/2009 at 10:01 AM, in message

[mapserver-users] Finding the centroid given the feature

2009-05-28 Thread Varun saraf
Hi, I know mapserver uses a point-in-polygon method to find a feature given a set of co-ordinates, but can it do the same thing reversed? For example. Each polygon I draw has a number associated with it which is in a dbf file with the same name as the shp file that mapserver uses to draw the

Re: [mapserver-users] Finding the centroid given the feature

2009-05-28 Thread Adam Eskreis
I'm not sure if this is what you are doing, but I have done something similar I think. When I want to use the centroid geometry of a polygon, what I do is load the layer into postgis, create a new geometry field called points_geom or something like that, and write a stand alone program to find