Created
December 11, 2018 08:20
-
-
Save KMR-zoar/6692e27f05eebc01970e1c9f29da1e49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let | |
| filePath = "?????.geojson", | |
| source = Json.Document(File.Contents(filePath)), | |
| converted2Table = Record.ToTable(source), | |
| features = converted2Table{5}[Value], | |
| fearure2table = Table.FromList( | |
| features, Splitter.SplitByNothing(), null, null, ExtraValues.Error | |
| ), | |
| expandedColumn1 = Table.ExpandRecordColumn( | |
| fearure2table, "Column1", { | |
| "id", "properties", "geometry" | |
| }, { | |
| "id", "Column1.properties", "Column1.geometry" | |
| } | |
| ), | |
| expandedColumn1.properties = Table.ExpandRecordColumn( | |
| expandedColumn1, | |
| "Column1.properties", | |
| {"name"}, | |
| {"name"} | |
| ), | |
| expandedColumn1.geometry = Table.ExpandRecordColumn( | |
| expandedColumn1.properties, | |
| "Column1.geometry", | |
| {"coordinates"}, | |
| {"Column1.geometry.coordinates"} | |
| ), | |
| extracted = Table.TransformColumns( | |
| expandedColumn1.geometry, { | |
| "Column1.geometry.coordinates", | |
| each Text.Combine(List.Transform(_, Text.From), ","), | |
| type text | |
| } | |
| ), | |
| splitted = Table.SplitColumn( | |
| extracted, | |
| "Column1.geometry.coordinates", | |
| Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), | |
| { | |
| "lon", | |
| "lat" | |
| } | |
| ), | |
| result = Table.TransformColumnTypes( | |
| splitted,{ | |
| {"lon", type text}, | |
| {"lat", type text} | |
| } | |
| ) | |
| in | |
| result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment