segunda-feira, 18 de janeiro de 2021

Como saber qual o Bounding Box, Envelope ou Retângulo Envolvente dos dados vetoriais

 

Quando você está precisando saber o retângulo envolvente de um shapefile pode utilizar o comando ogrinfo para saber esta informação pois o mesmo possui o atributo Extent que mostra exatamente o ponto inferior esquerdo e o superior direito conforme pode ser visto na figura abaixo.



O comando:

ogrinfo -so -rl mun_pa.shp
INFO: Open of `mun_pa.shp'
      using driver `ESRI Shapefile' successful.
Layer name: mun_pa
Metadata:
  DBF_DATE_LAST_UPDATE=2020-04-28
Geometry: Polygon
Feature Count: 144
Extent: (-58.898324, -9.841162) - (-46.060951, 2.591028)
Layer SRS WKT:
GEOGCRS["WGS 84",
    DATUM["World Geodetic System 1984",
        ELLIPSOID["WGS 84",6378137,298.257223563,
            LENGTHUNIT["metre",1]]],
    PRIMEM["Greenwich",0,
        ANGLEUNIT["degree",0.0174532925199433]],
    CS[ellipsoidal,2],
        AXIS["latitude",north,
            ORDER[1],
            ANGLEUNIT["degree",0.0174532925199433]],
        AXIS["longitude",east,
            ORDER[2],
            ANGLEUNIT["degree",0.0174532925199433]],
    ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
NM_MUNICIP: String (254.0)
CD_GEOCMU: String (254.0)
gid: Integer (4.0)
id_0: Integer (2.0)
id_1: Integer (2.0)