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

Handle (and show error) if some rows have no latitude/longitude #17

Open
gavinr opened this issue Feb 18, 2021 · 0 comments
Open

Handle (and show error) if some rows have no latitude/longitude #17

gavinr opened this issue Feb 18, 2021 · 0 comments
Assignees

Comments

@gavinr
Copy link
Owner

gavinr commented Feb 18, 2021

If some rows have missing latitude/longitude, that will create invalid GeoJSON so we cannot include those rows.

UI should alert user to which rows were removed from the output GeoJSON

Example CSV:

Id,Name,Latitude,Longitude,a
153,aa,40.172000,-88.834000,b
154,bb,39.216000,-1.051000,b
155,cc,46.471000,-119.333000,b
434,dd,,,b

Outputs:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -88.834,
          40.172
        ]
      },
      "properties": {
        "Id": "153",
        "Name": "aa",
        "a": "b"
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -1.051,
          39.216
        ]
      },
      "properties": {
        "Id": "154",
        "Name": "bb",
        "a": "b"
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -119.333,
          46.471
        ]
      },
      "properties": {
        "Id": "155",
        "Name": "cc",
        "a": "b"
      }
    },
    {
      "type": "Feature",
      "geometry": {},
      "properties": {
        "Id": "434",
        "Name": "dd",
        "a": "b"
      }
    }
  ]
}

Expected:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -88.834,
          40.172
        ]
      },
      "properties": {
        "Id": "153",
        "Name": "aa",
        "a": "b"
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -1.051,
          39.216
        ]
      },
      "properties": {
        "Id": "154",
        "Name": "bb",
        "a": "b"
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -119.333,
          46.471
        ]
      },
      "properties": {
        "Id": "155",
        "Name": "cc",
        "a": "b"
      }
    }
  ]
}
@gavinr gavinr self-assigned this Feb 18, 2021
@gavinr gavinr changed the title Handle (and show error) if some rows have now latitude/longitude Handle (and show error) if some rows have no latitude/longitude Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant