Your SlideShare is downloading. ×
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Demoiselle Spatial Latinoware 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Demoiselle Spatial Latinoware 2011

465

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
465
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. rafael.soto@
  • 2. OrquestraçãoBanco de Dados Espacial
  • 3. Motivação do Projeto ?[M u ltBanco de Dados Espacial idi sc ip l ina rid ad e]
  • 4. Mobilidade de Equipe
  • 5. Complexidade / Custo Funcionalidade / Tempo de Projeto
  • 6. JavaEE6JSR 318 - EJBJSR 315 – Servlet 3.0JSR 314 - JSF2JSR 317 - JPA2JSR 330 - CDIJSR 303 – Bean ValidatorJSR 299 - CDIoutras......
  • 7. Parênteses....
  • 8. Escopo Atual da Iniciativa Demoiselle Spatial Archetypes Doc v1.0Hibernate Spatial DEMOISELLE FW Examples JPA Extension FeatureGeocode KML Shapefile OGC-WS GeoRest Commom
  • 9. Arquétipo Demoiselle Spatial - ArquiteturaInterface Usuário OSMServidor de Aplicação HTTP Apresentação OL4JSF Lógica de NegócioJSR 318 - EJBJSR 315 – Servlet 3.0JSR 314 - JSF2 ...JSR 317 - JPA2JSR 330 - CDI Acesso a Dados SpatialJSR 303 – Bean ValidJSR 299 - CDIoutras......Banco de Dados SQL / JDBC Potsgis
  • 10. Arquétipo Demoiselle Spatial - Features ● Configuração do OL4JSF; <m:..../> ● Configuração do Hibernate Spatial ● Bibliotecas Dependentes; ● Configuração do Contexto de persistencia; ● Profile maven para JEE Containers; ● [Opcional] inclusão de código exemplo; ● [Opcional] configuração de todos os componentes do projeto$mvn archetype:generate -DarchetypeGroupId=br.gov.frameworkdemoiselle.spatial.archetype-DarchetypeArtifactId=demoiselle-spatial -DarchetypeVersion=1.0.0-SNAPSHOT-DarchetypeRepository=https://github.com/rafaelsoto/demoiselle-spatial/raw/master /mvn-repo/archetype-catalog-snapshot.xml
  • 11. Arquétipo Demoiselle Spatial – Integração Eclipsehttps://github.com/rafaelsoto/demoiselle-spatial/raw/master /mvn-repo/archetype-catalog-snapshot.xml
  • 12. Componente Demoiselle Spatial – Geocodingbr.gov.frameworkdemoiselle.spacial.component. geocoding
  • 13. Componente Geocodingclass TesteGeocoding{@Injectprivate Geocoding geocode;public void geocodeDummy(){ geocode .setAddress(“Rua Marechal Deodoro, Foz do Iguacu”) .setPostalCode(“85851-030”) .setLanguage(Language.Arabic) DSL .search(); GeocodeResponse GeocodeResult Point Address AddressParts
  • 14. Componente ReverseGeocodingclass ReverseGeocoding{@Injectprivate ReverseGeocoding reverseGeocode;public void geocodeDummy(){ reverse .setLocation("-12.9710208", "-38.4876078") .search();
  • 15. Implementações Nativas / Extensões (); e.search seG eocod Rever OpenStreetMap Geoc od e.sea rch() ;@Alternativeclass MyGeocodingProvider implements ReverseGeocoding; <alternatives> <class>my.package.geocode.impl</class> </alternatives
  • 16. Demoiselle Spatial – Componente FeatureCommombr.gov.frameworkdemoiselle.spacial.component. feature
  • 17. Entendendo o Componenteclass Aerodromo { private String icao; private String nome; private Point localizacao; /** Metodos de Acesso **/}BeanSimpleFeatureConverter.beanToSimpleFeature(aerodromo); SimpleFeature Attributes: icao, nome; Geometry: localizacao
  • 18. Modificando a Serializaçãoclass Aerodromo { @FeatureAttributeName(name="Codigo_Aeroporto") private String icao; @FeatureName(compositeName="Aeroporto $") private String nome; private Point localizacao; /** Metodos de Acesso **/}BeanSimpleFeatureConverter.beanToSimpleFeature(aerodromo);
  • 19. Demoiselle Spatial – Componente KML
  • 20. Componente KML em Açãoclass TesteKML{@Injectprivate KMLBuilder kml;public void kmlDummy(){ Kml.buildKmlAsFile(aerodromo, file); .buildKmlAsStream(aerodromo, inputstream); .buildKmlFromSimpleFeature(aerodromoSimpleFeature); .buildKml(aerodromo)
  • 21. Demoiselle Spatial – Componente ShapefileSHPSHXDBF
  • 22. Componente Shapefile em Açãoclass TesteShapefile{@Injectprivate ShapefileReader readerSHP;@Injectprivate ShapefileWriter writerSHP;public void shapefileDummy(){ writerSHP.writeBeanShapefile(aerodromo); .writeBeanShapefileToInputStream(aerodromo); .writeSimpleFeatureShapefile(aerodromoSimpleFeature); readerSHP.readShapefile(file);
  • 23. Demoiselle Spatial – Componente OGC-WS Base de Dados
  • 24. Componente OGC-WS em Açãoclass TesteOGCWSMetadata{@Injectprivate ServiceMetadataLookup ogcLookup;public void lookupOGCDummy(){ ogcLookup.lookup(URL_WMS,URL_WFS); WMS Service Capabilities WFS
  • 25. Componente OGC-WS em Açãoclass TesteOGCWFSGetFeatures{@Injectprivate WFSClient wfsClient;public void getFeaturesToKMLDummy(){ wfsClient.getFeature(SERVICE,LAYER_WFS);
  • 26. Extensão Hibernate Spatial JPA● Query nativa com argumentos Espaciais; Query.set(parameter,Geometry);Hibernate Query object. org.hibernate.Query hibernateQuery =((org.hibernate.ejb.QueryImpl)query).getHibernateQuery();Type geometryType = new CustomType(GeometryUserType.class, null); hibernateQuery.setParameter("filter", filter, geometryType);
  • 27. Extensão Hibernate Spatial JPA● Criação das Colunas Geométricas do Postgis; @Loader → Demoiselle @SRID("4326") → Demoiselle Spatial
  • 28. Extensão Hibernate Spatial JPA● Template JPASpatialDAO;extends JPASpatialDAO<Entidade, Long>● Consultas Espaciais com Argumentos:● private DemoiselleSpatialEnvelope extentFilter;● private Integer outputSRID;DAO.contains(GEOMETRY);
  • 29. Extensão Hibernate Spatial JPAT load(I id, SpatialQueryArgument spatialArgument);List<T> findAll(SpatialQueryArgument spatialArgument);List<T> intersects(Geometry geometry);List<T> intersects(Geometry geometry,SpatialQueryArgument spatialArgument);boolean verifyIntersects(Geometry geometry);boolean verifyIntersects(Geometry geometry,SpatialQueryArgument spatialArgument);List<T> equals(Geometry geometry);List<T> equals(Geometry geometry,SpatialQueryArgument spatialArgument);boolean verifyEquals(Geometry geometry);boolean verifyEquals(Geometry geometry,SpatialQueryArgument spatialArgument);List<T> disjoint(Geometry geometry);List<T> disjoint(Geometry geometry,SpatialQueryArgument spatialArgument);boolean verifyDisjoint(Geometry geometry);boolean verifyDisjoint(Geometry geometry,SpatialQueryArgument spatialArgument);List<T> touches(Geometry geometry);List<T> touches(Geometry geometry,SpatialQueryArgument spatialArgument);boolean verifyTouches(Geometry geometry);boolean verifyTouches(Geometry geometry,SpatialQueryArgument spatialArgument);
  • 30. Extensão Hibernate Spatial JPA List<T> crosses(Geometry geometry); List<T> crosses(Geometry geometry,SpatialQueryArgument spatialArgument); boolean verifyCrosses(Geometry geometry); boolean verifyCrosses(Geometry geometry,SpatialQueryArgument spatialArgument); List<T> within(Geometry geometry); List<T> within(Geometry geometry,SpatialQueryArgument spatialArgument); boolean verifyWithin(Geometry geometry); boolean verifyWithin(Geometry geometry,SpatialQueryArgument spatialArgument); List<T> contains(Geometry geometry); List<T> contains(Geometry geometry,SpatialQueryArgument spatialArgument); boolean verifyContains(Geometry geometry); boolean verifyContains(Geometry geometry,SpatialQueryArgument spatialArgument); List<T> overlaps(Geometry geometry); List<T> overlaps(Geometry geometry,SpatialQueryArgument spatialArgument); boolean verifyOverlaps(Geometry geometry); boolean verifyOverlaps(Geometry geometry,SpatialQueryArgument spatialArgument); List<T> relate(Geometry geometry,String relation); List<T> relate(Geometry geometry,SpatialQueryArgument spatialArgument,Stringrelation); boolean verifyRelate(Geometry geometry,String relation);
  • 31. Extensão Hibernate Spatial JPA● Geometry Bean Validator;@ExtentValidator(extent=”12.2121, -5.1212,15.123,-7.3213”)@Projection(srid=4326)
  • 32. Demoiselle Spatial – Componente GeoRest● Implementação da Especificação GeoJSON; { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": {"type": "Point", "coordinates": [102.0, 0.5]}, "properties": {"prop0": "value0"} }, { "type": "Feature", "geometry": { "type": "LineString", "coordinates": [ [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0] ] }, "properties": { "prop0": "value0", "prop1": 0.0 } }, { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ] }, "properties": { "prop0": "value0", "prop1": {"this": "that"} } } ] }
  • 33. Demoiselle Spatial – Componente GeoRest● Parser SimpleFeature2GeoJSON; SimpleFeature Attributes: icao, nome; Geometry: localizacao @Inject GeoJSONBuilder
  • 34. Demoiselle Spatial – Componente GeoRest● Template Rest - DelegateGeoRest;extends DelegateGeoREST<Entidade, Long, EntidadeDAO> void delete(I id); list(bbox,outputSrid); void insert(feature); GeoJSONFeatureCollection load(I id); void update(GeoJSONFeature feature);
  • 35. Template GeoREST na Pratica● Implementação de um template Rest;extends DelegateGeoREST<Entidade, Long, EntidadeDAO>http://localhost:8081/contact-list-spatial/georest/contact/list?bbox=-73.125,40.078125,-5.625,37.96875,-73.125,40.078125,-5.625,37.96875http://localhost:8081/contact-list-spatial/georest/contact/list?SRID=900913
  • 36. Escopo Atual da Iniciativa Demoiselle Spatial Archetypes Doc v1.0Hibernate Spatial DEMOISELLE FW Examples JPA Extension FeatureGeocode KML Shapefile OGC-WS GeoRest Commom
  • 37. Como contribuir
  • 38. Listas Brazucas! /geoserverInformações sobre ogrupoAssociados: 479Criado em: May 13,2007Idioma: Português /geojavaInformações sobre ogrupoAssociados: 355Criado em: Fev 25, 2006Idioma: Português
  • 39. rafael.soto@

×