You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
start by merging polygons and discarding all but exterior, largest poly?
dunno how to do that... missing step
If you want to do this with a more "GIS" flavor, then you need to select an unit-of-measure for your area and find an appropriate projection that preserves area (not all do). Since you are talking about calculating an arbitrary polygon, I would use something like a Lambert Azimuthal Equal Area projection. Set the origin/center of the projection to be the center of your polygon, project the polygon to the new coordinate system, then calculate the area using standard planar techniques.
<script src="lib/proj4js-combined.js"></script> //adjust the path for your server
// not sure about this, trying to define custom projection at 55 N 20 E... center of polygon, using meters
// Proj4js.defs["EPSG:8008"]="+title=LAMB azimuthal equal area +proj=laea +lat_0=55n +lon_0=20e +x_0=0.0 +y_0=0.0 +units=m";
// creating source and destination Proj4js objects
// once initialized, these may be re-used as often as needed
var source = new Proj4js.Proj(‘EPSG:4236’); //source coordinates will be in Longitude/Latitude
var dest = new Proj4js.Proj(‘EPSG:27563’); //destination coordinates in LCC, south of France
// transforming point coordinates
var p = new Proj4js.Point(-76.0,45.0); //any object will do as long as it has 'x' and 'y' properties
Proj4js.transform(source, dest, p); //do the transformation. x and y are modified in place
//p.x and p.y are now EPSG:27563 easting and northing in meters
Then use Geometry.poly_area() in Cartagen, result in meters, unsigned probably.
The text was updated successfully, but these errors were encountered:
Some notes and starter code for this:
start by merging polygons and discarding all but exterior, largest poly?
http://mathworld.wolfram.com/LambertAzimuthalEqual-AreaProjection.html
PROJ4.js: (support was added for Lambert Azimuthal Equal Area projection (proj=laea, ported from PROJ.4))
http://proj4js.org/
-- how to get the result of Lambert proj in meters?
proj_laea=Proj("+proj=laea +lat_0=55n +lon_0=20e +x_0=0.0 +y_0=0.0 +units=m")
proj_latlon=Proj("+proj=latlon")
transform(proj, Proj("+proj=latlon" ), 9999000, 8000000)
Proj4js.defs["EPSG:27563"]="+title=LAMB sud france +proj=lcc +lat_1=44.1 +lat_0=44.1 +lon_0=0 +k_0=0.999877499
+x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";
Proj4js.defs["EPSG:????"]="+title=???? +proj=laea +lat_0=55n +lon_0=20e +x_0=0.0 +y_0=0.0 +units=m";
Proj4js.defs["EPSG:8008"]="+title=LAMB azimuthal equal area +proj=laea +lat_0=55n +lon_0=20e +x_0=0.0 +y_0=0.0 +units=m";
// include the library
<script src="lib/proj4js-combined.js"></script> //adjust the path for your server// not sure about this, trying to define custom projection at 55 N 20 E... center of polygon, using meters
// Proj4js.defs["EPSG:8008"]="+title=LAMB azimuthal equal area +proj=laea +lat_0=55n +lon_0=20e +x_0=0.0 +y_0=0.0 +units=m";
// creating source and destination Proj4js objects
// once initialized, these may be re-used as often as needed
var source = new Proj4js.Proj(‘EPSG:4236’); //source coordinates will be in Longitude/Latitude
var dest = new Proj4js.Proj(‘EPSG:27563’); //destination coordinates in LCC, south of France
// transforming point coordinates
var p = new Proj4js.Point(-76.0,45.0); //any object will do as long as it has 'x' and 'y' properties
Proj4js.transform(source, dest, p); //do the transformation. x and y are modified in place
//p.x and p.y are now EPSG:27563 easting and northing in meters
Then use Geometry.poly_area() in Cartagen, result in meters, unsigned probably.
The text was updated successfully, but these errors were encountered: