Re: [mapserver-users] Calculate Bounding Box...

2009-03-12 Thread Gregor at HostGIS
I have a point in -8.0572,42.4702 (lon/lan). I like a bounding box 
arround 1 mile of this site. Can use any SRS like EPSG:4230 or another.


Hit up spatialreference.org
You can look up a SRS, then move a point over a map to get conversions. 
Very handy.




--
HostGIS, Open Source solutions for the global GIS community
Greg Allensworth - SysAdmin, Programmer, GIS Person, Security
Network+   Server+   A+   Security+
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Calculate Bounding Box...

2009-03-12 Thread Oscar Fdez.
Thanks for your answer.

¿Exist any formule to calculate the left/top lon/lan corner and the
right/bottom corner of Bounding Box dinamic from a lon/lan point?

Regards, Oscar.

2009/3/12 Gregor at HostGIS gre...@hostgis.com

 I have a point in -8.0572,42.4702 (lon/lan). I like a bounding box arround
 1 mile of this site. Can use any SRS like EPSG:4230 or another.


 Hit up spatialreference.org
 You can look up a SRS, then move a point over a map to get conversions.
 Very handy.



 --
 HostGIS, Open Source solutions for the global GIS community
 Greg Allensworth - SysAdmin, Programmer, GIS Person, Security
 Network+   Server+   A+   Security+

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] Calculate Bounding Box...

2009-03-12 Thread Julien-Samuel Lacroix

Hi,

Probably not totally exact, but enough for most people:

Miles per degree (latitude):  69
Miles per degree (Longitude): 69 * (cos(LATITUDE * PI / 180))

Julien

PS: Set of PHP functions from Chameleon
http://chameleon.maptools.org/

/**
 * Number of KM in a MILE
 * there are 5280 feet in a mile: start with 5280
 * there are 12 inches in a foot: multiple by 12
 * there are 0.0254 meters in an inch   : multiple by 0.0254
 * there are 1000 meters in a kilometer : divide by 1000
 */
define( KM_PER_MILE, (5280 * 12 * 0.0254 / 1000) );

/**
 * Constant returns miles per degree of latitude which is 69.
 */
define( MilesPerDegreeLat, 69 );
define( DegreesLatPerMile, (1 / 69.0) );


/**
 * function LonToLatRatio
 *
 * Given a latitude in decimal degrees, it will return the ratio of
 * longitude degress to latitude degrees.
 */
function LonToLatRatio ($latitude)
{
return cos($latitude * M_PI / 180);
}

/**
 * MilesPerDegreeLon($latitude)
 *
 * Given a latitude in decimal degrees, it will return the
 * miles per degree of longitude.
 */
function MilesPerDegreeLon ($latitude)
{
return 69 * LonToLatRatio($latitude);
}

/**
 * DegreesLonPerMile($latitude)
 *
 * Given a latitude in decimal degrees, it will return the
 * degrees of longitude per mile.
 */
function DegreesLonPerMile ($latitude)
{
return 1 / MilesPerDegreeLon( $latitude );
}

Oscar Fdez. wrote:

Thanks for your answer.

¿Exist any formule to calculate the left/top lon/lan corner and the 
right/bottom corner of Bounding Box dinamic from a lon/lan point?


Regards, Oscar.

2009/3/12 Gregor at HostGIS gre...@hostgis.com mailto:gre...@hostgis.com

I have a point in -8.0572,42.4702 (lon/lan). I like a bounding
box arround 1 mile of this site. Can use any SRS like EPSG:4230
or another.


Hit up spatialreference.org http://spatialreference.org
You can look up a SRS, then move a point over a map to get
conversions. Very handy.



-- 
HostGIS, Open Source solutions for the global GIS community

Greg Allensworth - SysAdmin, Programmer, GIS Person, Security
Network+   Server+   A+   Security+





___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


--
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users