Re: [mapserver-users] Showing pop up for a line
In my experience it's easier to do a buffer on the line features first (something nominal) which turns it into a polygon. In this way, the operators you want to use work consistently. - Original Message From: Subha Ramakrishnan su...@gslab.com To: Steve Lime steve.l...@dnr.state.mn.us Cc: mapserver-users@lists.osgeo.org Sent: Tuesday, January 6, 2009 12:04:13 AM Subject: [mapserver-users] Showing pop up for a line Hi, I am using Mapserver 5.0.2 with Openlayers. I've a line layer (from mapserver) shown on my base map(google physical). Now, when i click on a line, i want to show a pop using openlayers. I am able to do this for a polygon layer. I send the lat,lon of the point that is clicked and use the postgis query ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) to find the polygon (and fetch the polygon specific data to show on pop up) and attach the Openlayers popup to the point clicked. I am not able to do this for a line layer as the postgis query doesn't return anything. I tried this query also, ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) AND distance(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) = 1 but it doesn't work. Does any one know how to check if a point is a part of a line or if there is any other way to show the pop up? Thanks a lot for the help. Regards, Subha ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Showing pop up for a line
Hi, Thanks a lot for the reply. If i use ST_Contains(topology,st_expand(geomFromText('POINT(77.87117958068927 13.491965860913544)',-1), 10), can it be the case that more than one record will match the condition? And this will not work for me, as I need to have exactly one record to show the pop up. The constraint I'm facing in using Openlayers to draw the line layer is that the layer is too huge consisting of more than 20,000 features and the browser hangs because of too much memory being used in drawing the layer. Hence I am using mapserver for drawing the line layer. I did try other options here. The operator ~ [A ~ B (A completely contains B)] gives me more than one line(record) that matches the condition. But this cannot be the case to show the pop up. I did try to club it with other operators like and = but none of these seem to work. Thanks again. Regards, Subha Dan Little wrote: In my experience it's easier to do a buffer on the line features first (something nominal) which turns it into a polygon. In this way, the operators you want to use work consistently. - Original Message From: Subha Ramakrishnan su...@gslab.com To: Steve Lime steve.l...@dnr.state.mn.us Cc: mapserver-users@lists.osgeo.org Sent: Tuesday, January 6, 2009 12:04:13 AM Subject: [mapserver-users] Showing pop up for a line Hi, I am using Mapserver 5.0.2 with Openlayers. I've a line layer (from mapserver) shown on my base map(google physical). Now, when i click on a line, i want to show a pop using openlayers. I am able to do this for a polygon layer. I send the lat,lon of the point that is clicked and use the postgis query ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) to find the polygon (and fetch the polygon specific data to show on pop up) and attach the Openlayers popup to the point clicked. I am not able to do this for a line layer as the postgis query doesn't return anything. I tried this query also, ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) AND distance(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) = 1 but it doesn't work. Does any one know how to check if a point is a part of a line or if there is any other way to show the pop up? Thanks a lot for the help. Regards, Subha ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Showing pop up for a line
Why not use straight MapServer queries? Set a reasonable tolerance and that should work ok too. Steve On 1/6/2009 at 12:04 AM, in message 4962f45d.3010...@gslab.com, Subha Ramakrishnan su...@gslab.com wrote: Hi, I am using Mapserver 5.0.2 with Openlayers. I've a line layer (from mapserver) shown on my base map(google physical). Now, when i click on a line, i want to show a pop using openlayers. I am able to do this for a polygon layer. I send the lat,lon of the point that is clicked and use the postgis query ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) to find the polygon (and fetch the polygon specific data to show on pop up) and attach the Openlayers popup to the point clicked. I am not able to do this for a line layer as the postgis query doesn't return anything. I tried this query also, ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) AND distance(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) = 1 but it doesn't work. Does any one know how to check if a point is a part of a line or if there is any other way to show the pop up? Thanks a lot for the help. Regards, Subha ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Showing pop up for a line
You may also want to use mapserver to render the lines as a raster layer instead of vector. - Original Message From: Steve Lime steve.l...@dnr.state.mn.us To: Subha Ramakrishnan su...@gslab.com Cc: mapserver-users@lists.osgeo.org Sent: Tuesday, January 6, 2009 9:31:18 AM Subject: Re: [mapserver-users] Showing pop up for a line Why not use straight MapServer queries? Set a reasonable tolerance and that should work ok too. Steve On 1/6/2009 at 12:04 AM, in message 4962f45d.3010...@gslab.com, Subha Ramakrishnan wrote: Hi, I am using Mapserver 5.0.2 with Openlayers. I've a line layer (from mapserver) shown on my base map(google physical). Now, when i click on a line, i want to show a pop using openlayers. I am able to do this for a polygon layer. I send the lat,lon of the point that is clicked and use the postgis query ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) to find the polygon (and fetch the polygon specific data to show on pop up) and attach the Openlayers popup to the point clicked. I am not able to do this for a line layer as the postgis query doesn't return anything. I tried this query also, ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) AND distance(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) = 1 but it doesn't work. Does any one know how to check if a point is a part of a line or if there is any other way to show the pop up? Thanks a lot for the help. Regards, Subha ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Showing pop up for a line
Hi, I am using Mapserver 5.0.2 with Openlayers. I've a line layer (from mapserver) shown on my base map(google physical). Now, when i click on a line, i want to show a pop using openlayers. I am able to do this for a polygon layer. I send the lat,lon of the point that is clicked and use the postgis query ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) to find the polygon (and fetch the polygon specific data to show on pop up) and attach the Openlayers popup to the point clicked. I am not able to do this for a line layer as the postgis query doesn't return anything. I tried this query also, ST_Contains(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) AND distance(topology,geomFromText('POINT(77.87117958068927 13.491965860913544)',-1)) = 1 but it doesn't work. Does any one know how to check if a point is a part of a line or if there is any other way to show the pop up? Thanks a lot for the help. Regards, Subha ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users