Community Conundrum 25:Feature Visualization is now live! Read More

How to visualize US States

Level 2
Level 2
How to visualize US States

Hi,

I am using the churn use case/ project which has one column "state" with type string and meaning US State. Unfortunately, it is not possible to visualize the states in a map as Dataiku does not recognize them as a geo column.

 

asd.PNG

 

Is there anything I could do to get them on a map?

0 Kudos
8 Replies
Dataiker
Dataiker

Hi @lisa811 ,

 

You can use our Geocoder plugin for this purpose.

After installing it, simply create a Geocoder -> Forward geocoding recipe, select the input and output datasets.

In the address field of the recipe settings select a column containing the state code, for the geocoding provider you can use Arcgis. After running the recipe you'll have latitude + longitude columns. You may then create a prepare recipe with "Create GeoPoint from lat/lon" step to generate a single geopoint column.

 

Regards,

Andrey Avtomonov
R&D Engineer @ Dataiku
0 Kudos
Level 2
Level 2
Author

Hello Andrey,

 

thanks for the response. I already tried it this way. The output looks like this:

 

asd.PNG

 

One can observe that something goes wrong when the lat and lon are created. For example, the state LA gets some coordinates in Laos.

0 Kudos
Dataiker
Dataiker

Sorry for a misleading solution, I did a brief testing with a few cases where it worked...

Since it's a limitation of the geocoding service you can give it more context to improve the result.

For example you can create an intermediate prepare recipe that would prepend a state code with a country name:

 

Screenshot 2020-08-21 at 13.15.06.png

 Then if you use the newly generated column for geocoding you'd get the result like:

Screenshot 2020-08-21 at 13.17.33.png

Andrey Avtomonov
R&D Engineer @ Dataiku
Level 2
Level 2
Author

Thanks, looks like a great idea. I created that column, but now unfortunately when running the forward recipe I get the following error:

asd.PNG

0 Kudos
Dataiker
Dataiker

Hi @lisa811 ,

 

Could you copy the whole stack trace of an error?

Could you also try with Arcgis provider?

 

Regards

Andrey Avtomonov
R&D Engineer @ Dataiku
0 Kudos
Level 2
Level 2
Author

Here are the logs. For Arcgis another error occurs.

0 Kudos
Dataiker
Dataiker

May I ask you to also try to import a project attached to this message and see if you can "Forced recursive rebuild" the last dataset called "geocoded_geop" ?

 

Andrey Avtomonov
R&D Engineer @ Dataiku
0 Kudos
Level 2
Level 2
Author

Hello Andrey,

sorry for the late response, I was absent.

If I import and run the project you provided, I get the same error as I had before in my own project ("need more than 0 values..."). I don't know whats wrong here

0 Kudos