Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Modelando_PostGis_2016
Modelando_PostGis_2016
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Historia
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Introducción
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Por qué PostGIS?
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Qué es una BD espacial?
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Qué es la data espacial ?
(Spatial data)
➲ Data que describes la localización y/o
forma del objeto.
Por ejemplo :
Caminos, ríos, líneas electricas, bosques,
parques, casas, etc.
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Qué es la data espacial ?
(Spatial data)
➲ Abastracción de información.
➲ Representa entidades mediante puntos,
lineas y polígonos.
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Pero porque postgis?
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Desventajas de las BD espaciales
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Porque se usó PostgreSQL como base de
datos espacial ?
– Confiabilidad
– Costo 0 (open source)
– Soporta el estandar SQL.
– Permite agregar nuevos tipos de datos
– Este facila agregar nuevas funciones
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Software Cliente
Como me puedo comunicar con PostGIS?
• Usando estandar SQL
• FME (Safe Software): GIS translation/processing
• Mapserver (http://mapserver.gis.umn.edu), an OpenGIS Web
Map Server, GeoServer
• OGR (http://gdal.velocet.ca/projects/opengis/) - open source
GIS reader/writer
• ESRI shapefile reader/writer
• QGIS connection, AutoCAD, Java Viewer, Web Feature Server,
gvSIG, Udig, Kosmos, etc..
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
• Define primitivas geográficas.
• Indicar el SRID de un sistema de
referencia.
• Tipo de primitivas:
• Geográficas: grados WGS84, cálculos
curvos sobre un esferoide.
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
PostGIS – SQL geográfico
Crear tablas con columnas de tipos Insertar datos a partir de un string WKT:
geográficos
CREATE TABLE roads ( INSERT INTO global_points (name, location)
id INTEGER, VALUES (‘Town’,
road_name VARCHAR(25), ST_GeographyFromText('SRID=4326;POINT
geom GEOMETRY(LINESTRING, 4326) (-110 30)’)
); );
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Ejercicio 1
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Relaciones espaciales
➲ No solo sirven para almacenar las ubicaciones de
los objetos
➲ Permiten calcular relaciones entre objetos, que son
muy dificiles de modelar sin usar objetos espaciales.
➲ Las relaciones típicas entre objetos son :
• Proximidad : distancia
• Adjacencia : “touching” y “cenectividad”
• Contención : inside/overlapping
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Reaciones espaciales
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Spatial Relationships
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Spatial Relationships
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Spatial Relationships
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Conectividad. Como se relacionan los ríos ?
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Spatial Relationships
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Spatial Relationships
Adjacencia y contención
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Polígonos originales
Intersección
Union
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Alrededores
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Advantages of Spatial Databases
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Advantages of Spatial Databases
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
PostGIS – cálculos geográficos
Calcular la longitud total de una Obtener los puntos de una tabla
carretera cercanos a unas coordenadas
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Muchas organizaciones utilizan(o pueden usar)
Data espacial
➲ Direcciones Información del clima
➲ Ubicación de clientes Lotes
➲ Ubicación de tiendas Recursos naturales
➲ Tracking y transporte(UPS, Planeamiento de ciudades
DHL, FEDEX, Serpost) Planeamientos ambiental
➲ Estadísticas Visualización de datos
➲ Demografía Detección de amenzas
➲ Cartografía
➲ Epidemólogía
➲ Patrones de crímenes
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Porque colocar data espacial en una Base
de datos relacional(RDBMS)?
➲ Usualemnte se realaciona o tro tipo de información.
Esto permite preparar datos y relaciones más
complejos
➲ Medidores de luz: cuantos se usan, cuantos existen en un área,
última fecha de mantenimiento, a cual cliente se asocia esta cuenta,
etc.
➲ Ríos: flujo, temperaturas, presencia de peces, concentración de
químicos, etc.
➲ Bosques: Áreas, tipos de árboles, vegetación, valor monetario,
dueños de hectáreas, etc.
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Ventajas de las Bases de Datos Espaciales
La data espaciales es tratada como cualquier otro datos de una BD
– Backups
– Integrity checks
– Menor redundancia
– Operaciones básicas son manejadas por la BD
– Soporte Multiusuario.
– Seguridad / Control e Acceso
– Bloqueo
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Ventajas de las Bases de Datos Espaciales
Las tareas complejas son derivadas al motor de Base de
Datos.
– La organicación e indexación son hechas por la BD
– No se tienen que reimplementar operadores
– Tampoco funciones
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Ventajas de las Bases de Datos Espaciales
Consultas espaciales usando SQL
– Se usan experesiones SQL simples para determinar relaciones
espaciales.
• distance
• adjacency
• containment
– Se usan expresiones SQL simples para realizar operaciones
espaciales.
• area
• length
• intersection
• union
• buffer
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Ejercicio 2
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Bueno, y el uso cual es?
• Datos espaciales
• Web Mapping
• Sistemas de rutas
• CityGML
• Apps Moviles
• Crisis Mapping with crowdsourcing
• Sistemas de alertas
• ……
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Web Mapping Libraries
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Instant Mapping Applications with
PostGIS and Nodejs
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Smartcity – Postgis CityGML
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Smartcity – Postgis- CityGML
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Smartcity
Postgis CityGML
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Sistema de Rutas
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Apps móviles
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Apps móviles
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Mapping Crisis
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Sistemas de Alertas Tempranas
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Conclusiones
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Demostración
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
Preguntas ?
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/
FIN
RAUL ACEVEDO
GEO - CONSULTOR
rfacevedo@yahoo.com
http://geoportales.blogspot.com/