gis:project-lat-lon-from-ellipsoid
gis:project-lat-lon-from-ellipsoid latitude longitude ellipsoid-radius ellipsoid-inverse-flattening
Report the position, in NetLogo space, of the given latitude and longitude pair according to the current map projection and transformation and the given ellipsoid parameters.
Like the location-of
primitive, the reported xcor and ycor values are reported in a two-item list of [xcor ycor]
and an empty list if the specified point is outside of the bounds of the netlogo world.
The two defining parameters of a ellipsoid for the purposes of this primitive are the radius and the inverse flattening metric. These parameters can be easily found by examining either the WKT definition of a given projection/datum pair or the .prj file for the desired datum. For example, if you open the .prj file for a shapefile exported with the WGS66 datum in a text editor, you will see, somewhere in the file, this bit of text: DATUM["D_WGS_1966",SPHEROID["NWL_9D",6378145,298.25]]
. If you look at the SPHEROID
section of that text, the first number is the radius of that ellipoid and the second is the inverse flattening.
Once we have these numbers, we can project data that is relative to WGS66 like so:
let location gis:project-lat-lon my-lat my-lon 6378145 298.25
For more on earth ellipoids, see: https://en.wikipedia.org/wiki/Earth_ellipsoid
Take me to the full GIS Extension Dictionary