jeafreezy / nigeria_geodata

Fast and efficient access to geospatial data for Nigeria.
https://jeafreezy.github.io/nigeria_geodata
MIT License
5 stars 1 forks source link

Dev Realated Issues #11

Closed SammyGIS closed 3 months ago

SammyGIS commented 3 months ago
search_results = data_source.search("sam")
search_results

when i passed a search name that is not in the data source into the function it returns empty dataframe, i believe there is a better way we can handle it that returns and error, then shows the list of keywords that can be used to make a search.

# setting df as false to grab individual search result
search_results = data_source.search("education",False)
search_results

can we just do it when the wrong keyword is passed just ast the assertion in the state name, that it reruns error instead of empty list?

# list all data
data_source.list_data()

can the dataframe this function released also shows the last updated date?

nigeria_geodata/datasources/grid3.py

You didn't import pandas but you retutn a pd.Dataframe, it is raising NameError for function like

data_source.info('GRID3_NGA_Government_Buildings')

same module check line 178, remove maxRecordCount=response["maxRecordCount"], because it is always showing 2,000, instead passed this function ""__get_max_features"" and post the total point.

jeafreezy commented 3 months ago

1) For now, our search result is a basic string check (so you can search for a state name, data category, etc, it checks if your query is contained in the feature service name), there is no reserve list of keywords. Returning an error when a user searches is not a good UX. We can return empty to let them know that their search doesn't match any results. We can maybe include a message in the response and suggest to them to use list_data() to see the list of available datasets.

jeafreezy commented 3 months ago
  1. It's not provided in the root server, but we can get it from the metadata. However, it's not reliable. E.g this is throwing an error: https://services3.arcgis.com/BU6Aadhn6tbBEdyk/ArcGIS/rest/services/Buffer_of_Optimized_Vaccination_Sites/FeatureServer/info/metadata, but this is not: https://services3.arcgis.com/BU6Aadhn6tbBEdyk/ArcGIS/rest/services/NGA_LGA_Boundaries_2/FeatureServer/info/metadata. Also, that means we'll need to request to get the metadata of all the datasets, which might not be efficient.
jeafreezy commented 3 months ago

However, we can add it to the information of the info() method. So if a user wants more information about a dataset, they can find it there e.g https://services3.arcgis.com/BU6Aadhn6tbBEdyk/ArcGIS/rest/services/Africa_Country_Boundary/FeatureServer/35?f=pjson. it's under the 'editingInfo' object.