[GRASS-user] postgresql geometry parameter not respected in v.in.ogr -r

Markus Metz markus.metz.giswork at gmail.com
Thu Feb 28 01:04:24 PST 2019


On Tue, Feb 26, 2019 at 9:39 PM Markus Metz <markus.metz.giswork at gmail.com>
wrote:
>
>
>
> On Tue, Feb 26, 2019 at 9:17 PM patrick_s <patrick_GIS at gmx.net> wrote:
> >
> > Thanks Markus
> >
> > My GRASS-version is 7.4 from standard Ubuntu 18.04.2 LTS repository;
>
> This should work as expected. AFAICT, the spatial option and the -r flag
are properly passed to OGR.

Hmm, no, if the geometry option is given, the spatial filter was not
properly passed to OGR. Hopefully fixed in trunk r74137.

Markus M
>
> Are there any warnings or errors in the output messages of v.in.ogr?
>
> In order to help testing, you could use OGR directly to extract a spatial
subset:
>
> ogr2ogr -spat 2653156, 1249949, 2675000, 1267232 -geomfield geom_2 -f
GPKG test.gpkg "PG:dbname=psql_local" layer ${DBSCHEMA}.${DATASET}
>
> and test if you get the expected result.
>
> The arguments for ogr2ogr are derived from your information and untested.
>
> Markus M
>
> >
> > Regards,
> >
> > Patrick
> >
> >
> >
> > On 26/02/2019 21.12, Markus Metz wrote:
> >
> >
> >
> > On Tue, Feb 26, 2019 at 5:05 PM patrick_s <patrick_GIS at gmx.net> wrote:
> > >
> > > Dear list
> > >
> > > The syntax of v.in.ogr ignores the "geometry" Parameter, when using
the
> > > "spatial" Parameter or "-r". A workaround is the use of v.clip and
g.rename.
> > >
> > > I am a longterm user, but unregular user and have no userid to start a
> > > ticket. Hope this helps for future development nontheless.
> >
> > Of course it helps! Which GRASS version are you using? v.in.ogr has
changed quite a bit recently, therefore we recommend to use GRASS 7.6.
> >
> > Best,
> >
> > Markus M
> > >
> > > Best,
> > >
> > > Patrick
> > >
> > > #using flag "-r" and "spatial" finds "2990 vertices registered"
> > >
> > > v.in.ogr spatial="2653156, 1249949, 2675000, 1267232"
> > > input="PG:dbname=psql_local" layer=${DBSCHEMA}.${DATASET}
> > > out=gr_${DATASET}_${REFYEAR} type=point geometry="geom_2" -o --o
> > >
> > > v.in.ogr -r input="PG:dbname=psql_local" layer=${DBSCHEMA}.${DATASET}
> > > out=gr_${DATASET}_${REFYEAR} type=point geometry="geom_2" -o --o #2990
> > > vertices registered
> > >
> > > #clipping with same region after loading reduces to "1079 primitives
> > > registered"
> > >
> > > v.clip in=gr_${DATASET}_${REFYEAR} out=gr_${DATASET}clip_${REFYEAR} -r
> > >
> > > _______________________________________________
> > > grass-user mailing list
> > > grass-user at lists.osgeo.org
> > > https://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20190228/dc63d560/attachment.html>


More information about the grass-user mailing list