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

recline_map_view does not recognize GeoJSON fileds #2387

Closed
u10313335 opened this issue Apr 4, 2015 · 2 comments
Closed

recline_map_view does not recognize GeoJSON fileds #2387

u10313335 opened this issue Apr 4, 2015 · 2 comments
Assignees

Comments

@u10313335
Copy link
Contributor

If we try to create a recline_map_view (CKAN 2.3+) for data stored in the DataStore, the GeoJSON fields can not be listed since they are "text" fields rather than "numeric" fields.

It can be fixed by adding "text" type to the ReclineMapView extension (tested in my CKAN instance):

diff --git a/ckanext/reclineview/plugin.py b/ckanext/reclineview/plugin.py
index 20e204b..cc59163 100644
--- a/ckanext/reclineview/plugin.py
+++ b/ckanext/reclineview/plugin.py
@@ -178,7 +178,7 @@ class ReclineMapView(ReclineViewBase):

     datastore_fields = []

-    datastore_field_types = ['numeric']
+    datastore_field_types = ['numeric', 'text']

     def list_map_field_types(self):
         return [t['value'] for t in self.map_field_types]

If the above solution is right, I will send a PR then.

@amercader amercader self-assigned this Apr 7, 2015
u10313335 added a commit to taijiang-tw/ckan that referenced this issue Apr 9, 2015
change: accept tag length = 1
fix: ckan#2347
fix: ckan#2383 (merged into ckan/ckan)
fix: ckan#2387
mattfullerton added a commit to mattfullerton/ckan that referenced this issue Apr 30, 2015
As proposed in ckan#2387. It would have been nice to differentiate between the geojson field and the lat/long fields, but it's not possible without big changes elsewhere. I know this is assigned to someone else, but I need it now! ;-)
amercader added a commit that referenced this issue Jul 16, 2015
Because the datastore fields were limited to numeric ones (to
accommodate the lat/lon option), it was not possible to select a text
field for the geojson option.

This patch separates the types used on both, while keeping the
validation in place and not mixing types between options.
@amercader
Copy link
Member

Fix in #2537

amercader added a commit that referenced this issue Jul 16, 2015
Because the datastore fields were limited to numeric ones (to
accommodate the lat/lon option), it was not possible to select a text
field for the geojson option.

This patch separates the types used on both, while keeping the
validation in place and not mixing types between options.
amercader added a commit that referenced this issue Jul 16, 2015
Because the datastore fields were limited to numeric ones (to
accommodate the lat/lon option), it was not possible to select a text
field for the geojson option.

This patch separates the types used on both, while keeping the
validation in place and not mixing types between options.
@u10313335
Copy link
Contributor Author

Confirmed. Bug fixed. Thank you all!

mattfullerton pushed a commit to smartlane/ckan that referenced this issue Dec 7, 2016
Because the datastore fields were limited to numeric ones (to
accommodate the lat/lon option), it was not possible to select a text
field for the geojson option.

This patch separates the types used on both, while keeping the
validation in place and not mixing types between options.

Conflicts:
	ckanext/reclineview/plugin.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants