[gdal-dev] Meaning of First pass in reading GeoJSON

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Thu Sep 13 02:09:32 PDT 2018


Even Rouault wrote:
 
On jeudi 13 septembre 2018 08:00:00 CEST Rahkonen Jukka (MML) wrote:
>> Hi,
>> 
>> What does GDAL do when it reads the whole GeoJSON file as "GeoJSON: 
>> First pass"? Could it make the total process faster if user could give 
>> the same information that is gathered with the First pass somehow 
>> directly, or is that step needed in any case?

> The first pass does a full scan of the file to mostly detect the attribute schema and the layer geometry >type.
> In theory it could be omitted if the user had a way to provide that information, but that would mean a new format & code for that...

>Even

That certain dataset contains just geometries but no attributes. I do not know if geometries are all polygons of if multipolygons can also appear. However, I hoped that by setting the environment variable 
ATTRIBUTES_SKIP=YES and defining -nlt PROMOTE_TO_MULTI I could make GDAL to skip the first pass. I think that in this special case there is already a way to provide both the the schema and geometry type. I can also see that GDAL did read the ATTRIBUTES_SKIP setting correctly.

GeoJSON: Skip all attributes.
GeoJSON: First pass: 4136960 bytes read
...

-Jukka-


More information about the gdal-dev mailing list