Polygon Layer documentation - coordinate specification
See original GitHub issueBackground
Polygon layer coordinate specification
The documentation for polygon layer specifies the following data format
/**
* Data format:
* [
* {
* // Simple polygon (array of coords)
* contour: [[-122.4, 37.7], [-122.4, 37.8], [-122.5, 37.8], [-122.5, 37.7], [-122.4, 37.7]],
* zipcode: 94107,
* population: 26599,
* area: 6.11
* },
* {
* // Complex polygon with holes (array of coords)
* contour: [
* [[-122.4, 37.7], [-122.4, 37.8], [-122.5, 37.8], [-122.5, 37.7], [-122.4, 37.7]],
* [[-122.45, 37.73], [-122.47, 37.76], [-122.47, 37.71], [-122.45, 37.73]]
* ],
* zipcode: 94107,
* population: 26599,
* area: 6.11
* },
* ...
* ]
*/
I’ve just generated an example which has coordinates in the form of
{
"geometry":{
"type":"Polygon",
"coordinates":[
[
[-162.96333331843185, 23.963333318432139,-94860.0,1.0],
[-162.89693422519478, 23.963333318432139,-95135.0,1.0]
... etc
]
]
}
}
Where the elevation is specified as the 3rd value in each coordinate array (as per GeoJSON).
Which gives
Should the documentation reflect that you can specify the elevation in the coordinate array, as well as in the getElevation prop?
And is this a valid way to supply the elevation?
Related issue from my mapdeck library
Update
The same works for pathLayer
too, where you can specify the elevation in the coordinates [ ]
array
To Do List
- Add label and assign to milestone
- Coding
- Doc update
- Whats new update
- Test
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Polygon Layer documentation - coordinate specification #2435
Background Polygon layer coordinate specification The documentation for polygon layer specifies the following data format /** * Data format: ...
Read more >Creating a polygon grid with specified coordinates—ArcMap
With the Create Polygon Grid Wizard, you can define the size of the polygon grid using coordinates you specify. The size of the...
Read more >PolygonLayer - deck.gl
Compatible with the GeoJSON Polygon specification. A flat array or TypedArray of coordinates, in the shape of [x0, y0, z0, x1, y1, z1,...
Read more >GeoJSON specification
GeoJSON uses a geographic coordinate reference system, World Geodetic ... This document supersedes the original GeoJSON format specification [GJ2008].
Read more >polygon | Help - Mapbox docs
A polygon is a geospatial feature defined by connected pairs of latitude and longitude coordinates forming an area with at least three sides....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No problem!
@mdsumner I had the same question - hopefully this helps
Setting up some data (in R)
The polygons have a Z attribute. I’m making two plots, one using the
extrusion
, and one withoutNon-extruded
Just using the
Z
attribute on the dataExtruded
uses
getElevation
to extrude the polygon from the mapSo the
Z
is applied for each vertex. The extrusion is applied to the whole polygon, while respecting the initialZ
elevation (as both the base and top surfaces are tilted)