4
$\begingroup$

If one is trying to use SemanticImport to import geo data, how does one merge two separate columns (Lat and Lon) into one column that GeoCoordinates needs?

$\endgroup$
1
  • $\begingroup$ If my answer was helpful please consider upvoting it also. Thanks! $\endgroup$
    – user13892
    Feb 19 '20 at 20:54
0
$\begingroup$

Let's say your semantically imported dataset have columns for "Latitude" and "Longitude" with such names and now you replace them with a combined column for Mathematica's representation of geocoordinates as a GeoPosition by:

dataset=SemanticImport[...]

dataset=Query[All,<|
    KeyDrop[#,{"Latitude","Longitude"}],
    "GeoCoordinate"->GeoPosition[{#Latitude,#Longitude}]
|>&]@dataset
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.