| [19:44:24] | <NoahTarr[m]> | Hi everyone. I'm writing a script to parse kml files and convert them to farmOS log json objects. The KML file I have uses multi-geometry to represent the shape of blocks, but the farmOS log represents each shape as a geofield. How can I do the conversion between these? |
| [20:11:03] | <paul121[m]> | Hey Noah Tarr , I think you'll want to build a WKT string with "multiple polygons" |
| [20:12:00] | <paul121[m]> | What language are you writing your script with? ideally you could use a library to help with this. I think I may have used something for python in the past but not 100% sure |
| [20:31:40] | <NoahTarr[m]> | <paul121[m]> "What language are you writing..." <- Hi paul121, I'm using python. I tried googling it a bit but didn't have any luck finding a library. If you could link one I'd appreciate it. |
| [20:53:11] | <paul121[m]> | shoot, I had used this `geomet` library but seems like it is for GeoJSON -> WKT only |
| [20:53:11] | <paul121[m]> | https://github.com/geomet/geomet |
| [20:54:45] | <paul121[m]> | maybe you could convert the KML to GeoJSON? I find geojson to be a lot easier to work with. Perhaps an online tool can convert it while keeping all of your KML properties |
| [22:02:37] | <NoahTarr[m]> | I could try that. Any idea how the conversion is being done in farmOS because it only takes KML when importing areas then converts it to geofield when it stores the object. |
| [22:08:12] | <paul121[m]> | Good question, I'm only on my phone but looks like we do that here and the conversion largely happens with the geoPHP library: https://github.com/farmOS/farmOS/blob/7.x-1.x/modules/farm/farm_map/farm... |
| [22:08:12] | <paul121[m]> | You could check the geoPHP source for more details I think |
| [22:28:07] | * SpencerOnazi[m] has joined #farmos |