PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ gml_is_srid_planar()

static int gml_is_srid_planar ( int32_t  srid)
static

Return 1 if given srid is planar (0 otherwise, i.e geocentric srid) Return -1 if srid is not in spatial_ref_sys.

Definition at line 414 of file lwgeom_in_gml.c.

415{
416 char *result;
417 char query[256];
418 int is_planar, err;
419
420 if (SPI_OK_CONNECT != SPI_connect ())
421 lwpgerror("gml_is_srid_planar: could not connect to SPI manager");
422
423 /* A way to find if this projection is planar or geocentric */
424 sprintf(query, "SELECT position('+units=m ' in proj4text) \
425 FROM spatial_ref_sys WHERE srid='%d'", srid);
426
427 err = SPI_exec(query, 1);
428 if (err < 0) lwpgerror("gml_is_srid_planar: error executing query %d", err);
429
430 /* No entry in spatial_ref_sys */
431 if (SPI_processed <= 0)
432 {
433 SPI_finish();
434 return -1;
435 }
436
437 result = SPI_getvalue(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1);
438 is_planar = atoi(result);
439 SPI_finish();
440
441 return is_planar;
442}

Referenced by parse_gml_srs().

Here is the caller graph for this function: