rotate and fit based on polygon

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

rotate and fit based on polygon

Travis Kirstine
I have a bunch of polygons that represent 8.5 x 11 printed map sheets.  I'd like to produce images for each sheet that best fits the polygon within the outputted image.  We've tried using mapscript by setting the map extent based on the bbox of the source polygon and rotation but results aren't great depending on the orientation of the source polygon.  Is there a way to set the "extent" based on a polygon? 

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: rotate and fit based on polygon

Lime, Steve D (MNIT)

It’s kinda hard to picture what you’re after, any way to help visualize it?

 

From: mapserver-users [mailto:[hidden email]] On Behalf Of Travis Kirstine
Sent: Thursday, September 07, 2017 1:27 PM
To: [hidden email]
Subject: [mapserver-users] rotate and fit based on polygon

 

I have a bunch of polygons that represent 8.5 x 11 printed map sheets.  I'd like to produce images for each sheet that best fits the polygon within the outputted image.  We've tried using mapscript by setting the map extent based on the bbox of the source polygon and rotation but results aren't great depending on the orientation of the source polygon.  Is there a way to set the "extent" based on a polygon? 


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: rotate and fit based on polygon

Carlos Ruiz
In reply to this post by Travis Kirstine
Travis,

Do you have the polygons in PostGIS ? Maybe you can get the extent by using st_extent(geom) and retrieve it on PHP/Python to set the map extent. You could also get a margin by multiplying extent b 1.1 (10%).



On Thursday, September 7, 2017, 1:27:06 PM CDT, Travis Kirstine <[hidden email]> wrote:


I have a bunch of polygons that represent 8.5 x 11 printed map sheets.  I'd like to produce images for each sheet that best fits the polygon within the outputted image.  We've tried using mapscript by setting the map extent based on the bbox of the source polygon and rotation but results aren't great depending on the orientation of the source polygon.  Is there a way to set the "extent" based on a polygon? 
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: rotate and fit based on polygon

Travis Kirstine
Thanks Carlos, we've employed the method you've suggested already but not getting the results we are looking for, perhaps the linked image will help illustrate my problem  

 


On 8 September 2017 at 16:25, Carlos Ruiz <[hidden email]> wrote:
Travis,

Do you have the polygons in PostGIS ? Maybe you can get the extent by using st_extent(geom) and retrieve it on PHP/Python to set the map extent. You could also get a margin by multiplying extent b 1.1 (10%).



On Thursday, September 7, 2017, 1:27:06 PM CDT, Travis Kirstine <[hidden email]> wrote:


I have a bunch of polygons that represent 8.5 x 11 printed map sheets.  I'd like to produce images for each sheet that best fits the polygon within the outputted image.  We've tried using mapscript by setting the map extent based on the bbox of the source polygon and rotation but results aren't great depending on the orientation of the source polygon.  Is there a way to set the "extent" based on a polygon? 
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: rotate and fit based on polygon

Lime, Steve D (MNIT)

Looks like you need to use the polygon extent to compute the rotation angle but then should use the extent of the rotated polygon for the map extent.




From: Travis Kirstine <[hidden email]>
Sent: Friday, September 8, 2017 9:23 PM
To: Carlos Ruiz; Lime, Steve D (MNIT)
Cc: [hidden email]
Subject: Re: [mapserver-users] rotate and fit based on polygon
 
Thanks Carlos, we've employed the method you've suggested already but not getting the results we are looking for, perhaps the linked image will help illustrate my problem  

 


On 8 September 2017 at 16:25, Carlos Ruiz <[hidden email]> wrote:
Travis,

Do you have the polygons in PostGIS ? Maybe you can get the extent by using st_extent(geom) and retrieve it on PHP/Python to set the map extent. You could also get a margin by multiplying extent b 1.1 (10%).



On Thursday, September 7, 2017, 1:27:06 PM CDT, Travis Kirstine <[hidden email]> wrote:


I have a bunch of polygons that represent 8.5 x 11 printed map sheets.  I'd like to produce images for each sheet that best fits the polygon within the outputted image.  We've tried using mapscript by setting the map extent based on the bbox of the source polygon and rotation but results aren't great depending on the orientation of the source polygon.  Is there a way to set the "extent" based on a polygon? 
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users