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

Adds field to select or type an administrative region in the georeferenciation by city name panel #3306

Merged
merged 16 commits into from
Apr 24, 2015

Conversation

alonsogarciapablo
Copy link
Contributor

This PR basically adds a new field to select a column or type the name of an admin region when georeferencing by city name:

captura de pantalla 2015-04-20 a las 13 32 36

The frontend now sends two new params to the GeocodingsController:

  • region, which contains the name of the column that contains regions or the region typed by the user.
  • region_text, which is true if region contains some text, or false if it contains the name of the column.

We now have 4 SQL generators to geocode by name:

  • CitiesTextTextPoints
  • CitiesTextColumnPoints
  • CitiesColumnTextPoints
  • CitiesColumnColumnPoints

I'm not super happy with the names, so I'm open to suggestions :)

The rest of generators had to be accommodated to work with the new region column that was added to the temporary table that is used during the georeferencing process.

If you want to give it a try, you can use the city "Dover", which is present in many different states, like: "Minnesota", "Delaware", "New Jersey", etc.

I didn't find much tests related to geocoding and that's the reason why this PR contains no tests :(

Fixes #3105.

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@@ -96,7 +96,7 @@
// Set model
var a = {};
a[this.options.property] = val;
a['text'] = isText ? true : false;
a[this.options.text || 'text'] = isText ? true : false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were always passing "text" as "options.text", but we were not using that option.

@alonsogarciapablo alonsogarciapablo changed the title Adds field for Admin.Regions to the georeferenciation by city name panel Adds field to select or type an administrative region in the georeferenciation by city name panel Apr 21, 2015
@alonsogarciapablo
Copy link
Contributor Author

This PR touches both the backend and the frontend.

@Kartones @javisantana @xavijam can you please take a look at it? Thanks!

@@ -11,6 +11,10 @@
<div class="geocoding-pane-select kind"></div>
</li>
<li>
<label class="geocoding-pane-label">Admin.Region where city's located, if known</label>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A whitespace is missing here. "Admin. Region" should be the correct one

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@xavijam
Copy link
Contributor

xavijam commented Apr 22, 2015

About frontend code 👍

@Kartones
Copy link
Contributor

I know there are not many specs, but I'm afraid we're propagating the illness by not adding tests for at least the new system. Either mocking/stubbing, or creating a table and populating with some dummy data to check it "looks ok". But I also don't know the internals of SQL functions like geocode_postalcode_polygons so... up to you, if is too much then go ahead with manual testing for the time being.

👍

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@alonsogarciapablo
Copy link
Contributor Author

Thanks @Kartones! I'm adding some basic tests.

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

- Country column is present but region is empty
- Country name is present but region is empty
@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

@Cartofante
Copy link
Collaborator

Frontend tests were OK 👍 (details)

alonsogarciapablo added a commit that referenced this pull request Apr 24, 2015
Adds field to select or type an administrative region in the georeferenciation by city name panel
@alonsogarciapablo alonsogarciapablo merged commit ba8e0c1 into master Apr 24, 2015
@alonsogarciapablo alonsogarciapablo deleted the 3105-add-admin1-to-city-geocoder branch April 24, 2015 08:46
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

Successfully merging this pull request may close these issues.

Add option: search for city names in admin1
5 participants