Tag Info

New answers tagged

3

If you want to do this "right" (taking into account the fact that latitude and longitude are angular units, and using an ellipsoid as a model of the earth's shape), you can try using the geographiclib library, which is a Python version of Charles Karney's Algorithms for geodesics. See also the Wikipedia page Geodesics on an ellipsoid for a look into some of ...


4

It is easiest with shapely: from shapely.geometry import box extents = [(-180.0, -90.0, 180.0, 83.624), (-124.731, 24.956, -66.97, 49.372), (-122.42, -37.818, 151.207, 52.516)] for i in extents: a = box(i[0],i[1],i[2],i[3]) print i, a.area (-180.0, -90.0, 180.0, 83.623999999999995) 62504.64 (-124.73099999999999, 24.956, -66.969999999999999, ...


6

Main problem is getting the area of the extent. I wrote a quick ogr function to do this def extentArea(extent): #Unpack extent tuple to coordinates minX, minY, maxX, maxY = extent #unpack the tuple #Create empty geometry and add vertices geom = ogr.Geometry(type = ogr.wkbLinearRing) geom.AddPoint_2D(minX,minY) ...


0

I looks like the service may not be responding to WCS 1.1.2 request parameters. It does respond to a 1.0.0 request even though this version is not advertised like: WCS 1.0.0 request to DTM_75m service


2

One idea would be to hide the WMSLayer entirely if the map's extent is outside the layers "valid" extent. Based on this answer, one could listen to the map's extent-change event and check if the map's current extent is acceptable: map.on("extent-change", function () { // Check if map.extent is acceptable, otherwise hide the WMSLayer. if ...


4

The Ogr function GetEnvelope() returns "a tuple (minX, maxX, minY, maxY)" (from here), but what you want (from what I can understand) is a Polygon describing the envelope/bbox? This is actually rather simple, as the tuple (minX, maxX, minY, maxY) is all you need to create a Polygon. Just create a Polygon based these, like so: from osgeo import ogr def ...



Top 50 recent answers are included