Datatamer / Datatamer/tamr-client

Geospatial equivalent of `create_from_dataframe()`

Open
#373 0 comments 0 reactions 0 assignees View on GitHub
🙋‍♀️ Feature Request
Dominant language
Python
Stars
11
Forks
24
PR merge metrics
No merged PRs in 30d

Description

# 🙋 feature request

Just as normal pandas DataFrames can be created using the `create_from_dataframe()` method, it would be great if we could do the same for a `GeoPandasDataFrame`.

## 🤔 Expected Behavior

```
tc.create_from_geodataframe(geodf, primary_key='primary_key', name='my_dataset')
```
Which would create the dataset, generate the attributes—and set the geometry as the correct type.
## ⚠️ Warning!

When setting the primary key and using the `__geo_interface__` implementation of geopandas, the value in `feature['id']` is based on the index of the GeoDataFrame.
To manually set this to a different column, `geodf.index = geodf['my_primary_key']` can be used.

## 🔦 Context

Using the geoJSON API endpoint is less than ideal as all column fields need to be specified in the curl command.
Having it integrated neatly would also allow us to leverage the many types of geospatial data that geopandas can read. (shape files, etc.)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing create_from_dataframe() implementation and then inspect how a GeoPandasDataFrame exposes data through __geo_interface__. Done means adding the requested geospatial creation path so it creates the dataset, generates attributes, and preserves geometry types, including the documented primary-key behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.