[OSM-talk] recommendation for JSON to CSV converter

Florian Lohoff f at zz.de
Fri Mar 1 13:52:54 UTC 2024


On Thu, Feb 29, 2024 at 10:17:28PM +0100, Martin Trautmann wrote:
> On 28.02.24 22:58, Florian Lohoff wrote:
> 
> > For these kind of simple conversions there is no need for programming.
> >
> > Its a GeoJSON Featurecollection. So a list of GeoJSON features,
> > each of them having a "properties" objects with all the attributes
> >
> > jq -r ".features[] | [.properties.Strassenna,.properties.HsNr_Zus,.properties.Xg,.properties.Yg] | @csv" Hauskoordinaten_0822.geojson
> > "Stinnesstr.","8",7.010088,51.525567
> > "Timpestr.","29",7.010417,51.522377
> > "Hattramstr.","31",7.003345,51.52098
> > "Spakenbroich","69",7.003248,51.523044
> > "Bertramstr.","36",7.005647,51.522393
> > "Bertramstr.","38",7.005608,51.522429
> > "Bertramstr.","40",7.005566,51.522469
> > [...]
> 
> Thanks, that worked pretty well. So I'll have a closer Look at jq now.
> 
> I'll have to figure out why the geojson contains 99 606 records only,
> although the former version contains 4 418 144 records

Most likely lines, not records. A JSON objects spans a lot of rows so
counting rows is the issue.

2.5 Mio lines, 99606 Features, 1 Featurecollection.

flo at p5:~$ wc -l Hauskoordinaten_0822.geojson 
2589766 Hauskoordinaten_0822.geojson
flo at p5:~$ rgrep Feature Hauskoordinaten_0822.geojson  | wc -l
99607

For obvious reasons Essen cant have 2.5 or even 4.4 Mio addresses.

Flo
-- 
Florian Lohoff                                                     f at zz.de
  Any sufficiently advanced technology is indistinguishable from magic.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20240301/437efaff/attachment.sig>


More information about the talk mailing list