Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Solve the issue of geojson attribute visualization" #152

Merged
merged 1 commit into from
Mar 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions topojson/core/extract.py
Original file line number Diff line number Diff line change
@@ -458,19 +458,13 @@ def _extract_featurecollection(self, geom):

# each Feature becomes a new GeometryCollection
for idx, feature in enumerate(obj["features"]):
# A GeoJSON Feature is mapped to a GeometryCollection => directly mapped to specific geometry, so that to save the attributes
feature["type"] = feature["geometry"]['type']
# feature["geometry"] = feature["geometry"]
# feature.pop("geometry", None)

### here not save the features for visualization:
data["feature_{}".format(str(idx).zfill(zfill_value))] = {**feature['properties'],**{'geometry':geometry.shape(
feature['geometry']
)}} # feature

# data["feature_{}".format(str(idx).zfill(zfill_value))] = geometry.shape(
# feature
# ) # feature
# A GeoJSON Feature is mapped to a GeometryCollection
feature["type"] = "GeometryCollection"
feature["geometries"] = [feature["geometry"]]
feature.pop("geometry", None)
data["feature_{}".format(str(idx).zfill(zfill_value))] = geometry.shape(
feature
) # feature

# new data dictionary is created, throw the geometries back to main()
self._is_single = False