12
FME WORK PROJECT GIANNI GORGOGLIONE PROJECT AS SIGNMENT METHODOLOGY Figure 1 WORK FLOWCHART 1

FME PROJECT - GIS

Embed Size (px)

DESCRIPTION

Workflow example of a FME geodatabase created in SQL and ArcGIS map.

Citation preview

FME WORK PROJECT

GIANNI GORGOGLIONE

PROJECT ASSIGNMENT

METHODOLOGY

Figure 1 WORK FLOWCHARTThe project started with the creation of the Geodatabase in order to add the following input source data: OSM

SGU

SEDD

Then it was necessary to convert the Geographical Reference System from LL84 (WGS84) to SWEREF 99 TM (See Appendix A, figure 1). This operation was conducted directly on the shapefiles of the dataset outside of the Geodatabase due to software problems. Thus, the conversion and the clipper operation were made by FME. To make the clip of the area of interest a mask was created by using ArcGIS. This mask extent covered the Scania region that it was extracted by OSM data source. However, the clipper operation encountered several problems and it worked only one by one for each shape file (See Appendix A, figure 2).To add SGU to the Geodatabase the column of soil description in English was added to the other one in Swedish. This operation was made by using the function Attribute Value Mapper in FME (See Appendix A, figure 3). An odd event occurred in making this operation because it was not working with a last version of excel file. So it was necessary to convert it to the older version and more properly from Soil.xlsx to Soil.xls.

When the conversion to SWEREF 99 TM of the three data sources was made and the new attributes was added to the soil table, the data sources were transferred to the Geodatabase one by one since it did not work by doing it all at once. The step of adding the SEDD data source to a GeoDataBase was postponed to the next phase because it was thought more convenient adding a new data set (mainly in shapefile) to an existing GeoDataBase.

Afterwards, SGU and SEDD were added to PostgreSQL database. To execute this step it was created another database (part of the main) to store only SEDD and SGU: GDB_p1.gdb (See Appendix A, figure 4). The following step was done all by using queries in PostGIS environment with the program Pgadmin. According to the instructions it was supposed to create a table with information about three dominating soil types for each property unit but it was difficult to apply into the query language SQL. Thus, it was easier to make the query with only one dominant soil type. NOTE: During this step a procedural problem occurred. In the main task of the project is asked to perform some queries according to the main purpose of this project: construct a geographical database that stores which soil types that are dominating each property unit. According to this work strived to overlay the two shapefiles (SEDD and SGU) with the aim to obtain a single layer with both information from SEDD and SGU attribute tables. But it was not possible based on the result from the intersection executed in FME. The function Clipper, AreaOnAreaOverlay with Intersector was tried but it seemed that these function did not keep the attributes from both the input layers. Instead it looks that the results of them depend only by the target layer in the output (FME-Writer). The main idea in this case it was to perform an equivalent intersection as the one in the ESRI ArcMap where the result of a polygon over polygon intersection is a new layer whereof new polygons are stored with all attributes coming from the two (or more) input polygon layers. This operation was done with the creation of an Hg mask in ArcMap (dissolve tool) and then it was clipped in FME (clipper) SGU layer with Hog_mask.shp.At the end of this project, the database was imported from PostGIS/PostgreSQL to ArcGIS. The function time in ArcGIS made it possible to create an animation of the property unit change during a specified time interval.

DATABASE DOCUMENTATION

Table property_land_use101: attributes sum up

AttributeData typeDescriptionOrigin

unitIntegerIt contains the object identification number from the original data set about Hg parish (renamed prop_id)Property units

(table prop)

property_uTextIt is the identification number of the property unit.Property units

(table prop)

engTextSoil type in englishLand use cover

(table land_use)

startdatemTextFrom historical sources, the year when the object was createdProperty units

(table prop)

enddatemTextFrom historical sources, the year when the object disappearedProperty units

(table prop)

Land_use_areaFloatIt shows the total area, within each property unit, of a ceratin soil typeFrom SQL query:

SUM(ST_AREA(ST_INTERSECTION(prop.geom, land_use.geom)))

land_geomGeometry

(polygon)Geometry of each property unit polygonFrom SQL query:ST_Intersection(prop.geom, land_use.geom)

Table perc: attributes sum up

AttributeData typeDescriptionOrigin

prop_idIntegerIt contains the object identification number from the original data set about Hg parishProperty units

(table prop)

property_uTextIt is the identification number of the property unit.Property units

(table prop)

engTextSoil type in englishLand use cover

(table land_use)

shape_areaFloatTotal property unit areaProperty units

(table prop)

Land_use_areaFloatIt shows the total area, within each property unit, of a ceratin soil typetable property_land_use101

percFloatProportion of the considered soil type within each property unitFrom SQL query:

round(land_use_area*100/shape_area)

In the end we produce a final table to be imported into ArcGIS as follow:

AttributeData typeDescriptionOrigin

unitIntegerIt contains the object identification number from the original data set about Hg parish (renamed prop_id)Property units

(table prop)

property_uTextIt is the identification number of the property unit.Property units

(table prop)

engTextSoil type in englishLand use cover

(table land_use)

startdatemTextFrom historical sources, the year when the object was createdProperty units

(table prop)

enddatemTextFrom historical sources, the year when the object disappearedProperty units

(table prop)

Land_use_areaFloatIt shows the total area, within each property unit, of a ceratin soil typeFrom SQL query:

SUM(ST_AREA(ST_INTERSECTION(prop.geom, land_use.geom)))

land_geomGeometry

(polygon)Geometry of each property unit polygonFrom SQL query:ST_Intersection(prop.geom, land_use.geom)

percFloatProportion of the considered soil type within each property unitFrom SQL query:

round(land_use_area*100/shape_area)

m_idFloatA serial index created in PostGIS to allow ArcGIS to create an internal indexFrom SQL query:

ALTER TABLE property_land_use101 ADD m_id SERIAL

DATABASE MAPS

Figure 2 SGU layer in GDB_hog.gdb

Figure 4 Scania Region from the input data (roads vector layer in SWEREF 99 TM)

Figure 6: Geodatabase visualization in pgAdmin III

APPENDIX A

Figure 3: Adding english soil types names into the shapefile SGU (join: JG2_TX - ENG)

Figure 4: procedure in FME to store shapefiles SEDD and SGU to a GeoDataBase (GDB_p1.gdb)APPENDIX B

DOMINATING SOIL TYPE

CREATE TABLE property_land_use_SUM4 AS(

SELECT prop_id, property_u, eng, SUM(ST_AREA(ST_INTERSECTION(prop.geom, land_use.geom))) AS land_use_area

FROM prop, land_use

GROUP BY prop_id, property_u, eng

HAVING SUM(ST_AREA(ST_INTERSECTION(prop.geom, land_use.geom)))>0)

CREATE VIEW SUM4 AS(

SELECT * FROM property_land_use_SUM4

ORDER BY prop_id,land_use_area DESC)SELECT * FROM SUM4

TO ADD the total area of each single property unit within our new table and calculate the proportion (%) of each soil type within each property unit

CREATE TABLE perc AS

SELECT prop.prop_id, prop.property_u, eng, shape_area , land_use_area, round(land_use_area*100/shape_area) AS percFROM property_land_use_SUM4 INNER JOIN prop ON property_land_use_SUM4.prop_id=prop.prop_id

SELECT * FROM perc

## TABLE WITH TIME FOR EACH PROPERTY UNIT INTERSECTED WITH SOIL TYPES CREATE TABLE property_land_use101 AS(

SELECT unit, property_u, eng, prop.startdatem, prop.enddatem, SUM(ST_AREA(ST_INTERSECTION(prop.geom, land_use.geom))) AS land_use_area, ST_Intersection(prop.geom, land_use.geom) AS land_geom

FROM prop, land_use

GROUP BY unit, property_u, eng,prop.geom, land_use.geom,prop.startdatem, prop.enddatem

HAVING SUM(ST_AREA(ST_INTERSECTION(prop.geom, land_use.geom)))>0

)

CREATE VIEW property_land_use101 AS(

SELECT * FROM property_land_use101

ORDER BY unit, prop_id,land_use_area DESC)

View the content of the geographical database

##Add an extra column to use as INDEX for the table property_land_use_101 for transferring it from pgadmin to arcgis

ALTER TABLE property_land_use ADD m_id SERIALFigure 3 SEDD layer in GDB_hog.gdb

Figure 5 Property unit change during time

Figure 7 Database in ArcGIS

Figure 1: Reference System Transformation

from LL84 to SWEREF 99 TM (performed with FME)

Figure 2: Clip performed with FME between the Scania Mask (Mask) and vector shapefiles in SWEREF 99 TM

12