Comments (3)
Unless I'm missing something about what you are trying to do here, it should be this:
gdf = gpd.GeoDataFrame(
[(v, shape(g)) for g, v in rasterio.features.shapes(layer)],
columns=["value", "geometry"],
crs=src.crs
)
The shapes extracted from the GeoTIFF are in the same CRS as the GeoTIFF.
From your transform
, your pixels are not integer in size, so even if you converted your shape coordinates to pixel offsets within the GeoTIFF (translating them so that they are based on the origin point of the raster from the transform
rather than the origin point of the CRS), they wouldn't be integer values, so you'd still have a floating point precision problem in addition to needing to define a custom CRS. Seems best to just keep your coordinates in the original CRS.
Feature coordinates don't have a concept of transform
as used within a raster, which is really just a way of storing the parameters needed to calculate the position within the coordinate space specified by the CRS of each pixel within the raster.
from geoparquet.
Perhaps I wasn't clear -- calling rasterio.features.shapes
without specifying the transform
kwarg means that the geometries are aligned to the pixels in the geotiff.
We can store these geometries into a regular parquet file with some metadata that describes the x, y, z, width, height
of the original raster file. Downstream processing often doesn't care about the projection of the points (i.e. calculating intersections between features extracted from different layers), and so it is numerically nice if this is all performed in the same space of all values existing between 0, 2048
.
However, it would also be nice if we could drag that parquet file into a tool like QGIS and have it land in the correct spot (like you can do with the geotiff, or a mapbox vector tile). For this, I guess we would need the transform
just as the geotiff does.
Feature coordinates don't have a concept of transform as used within a raster, which is really just a way of storing the parameters needed to calculate the position within the coordinate space specified by the CRS of each pixel within the raster.
This probably answers my question... it is not something that is normally done.
from geoparquet.
You can store a per-row geotransform by storing an Arrow FixedSizeList with 6 float numbers per row.
from geoparquet.
Related Issues (20)
- Simplify or remove script dependencies HOT 3
- PROJJSON schema version HOT 4
- Metadata encoding options for GeoArrow-encoded columns in GeoParquet metadata HOT 2
- Recommendation on the Arrow specific type for the WKB geometry column ? HOT 5
- Antimeridian Crossings and bbox HOT 9
- Update example files for 1.1 HOT 4
- The releases on the repository can be misleading regarding the status of GeoParquet as an OGC Standard HOT 1
- Clarify projection of bounding box columns HOT 4
- Mixed concerns: Encoding + Geometry Type HOT 15
- Covering Schema
- Clarify recommended file extension HOT 9
- List of Submitting Organisations HOT 3
- Enforce pull requests and approvals for all repository updates HOT 4
- Require status checks to pass before merging HOT 4
- Synchronise requirements in the metanorma asciidoc files with those in the gpq validator HOT 1
- add support wkt or wkt2 formats for crs HOT 26
- Thoughts about a first-class GEOMETRY data type in Parquet? HOT 20
- Start a 'best practices' document
- Forward compatibility guarantees? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geoparquet.