The document discusses various concepts and techniques for working with geospatial data, including:
- Storing geospatial data such as points, lines, and polygons using SQL Server spatial data types and the Entity Framework.
- Creating map services and consuming them using REST and JavaScript APIs to display geospatial data and perform analysis in web applications.
- Key GIS concepts like layers, symbology, map documents, and map services that are used to visualize and share geospatial data and analysis results.
6. HOW TO STORE A DAM?
6
http://www.flickr.com/photos/85272145@N00/3288359866
7. STORING A DAM USING A TABLE
7
Id Name Material Height
78 Suhaia Stone 5
79 Vlasin Stone 7
80 Vieru 2 Earth 5
81 Vieru 3 Earth 7
82 Magura Earth 2
83 Putineiu Other 4
84 Rojistea Wood 8
85 Cascioarele Wood 4
86 Luncavita Unknown 4
87 Catuna Stone 10
88 Malina Stone 8
8. HOW TO STORE DAM‘S LOCATION?
8
Id Name Material Height Location
78 Suhaia Stone 5 ?
79 Vlasin Stone 7 ?
80 Vieru 2 Earth 5 ?
81 Vieru 3 Earth 7 ?
82 Magura Earth 2 ?
83 Putineiu Other 4 ?
84 Rojistea Wood 8 ?
85 Cascioarele Wood 4 ?
86 Luncavita Unknown 4 ?
87 Catuna Stone 10 ?
88 Malina Stone 8 ?
9. USING DESCRIPTIVE WORDS ...
9
Id Name Material Height Location
78 Suhaia Stone 5 In Valea Adanca
79 Vlasin Stone 7 Near Schitu locality
80 Vieru 2 Earth 5 500 meters from Mitoc
81 Vieru 3 Earth 7 On the river Parapanca
82 Magura Earth 2 3 km upstream
83 Putineiu Other 4 ...
84 Rojistea Wood 8 ...
85 Cascioarele Wood 4 ...
86 Luncavita Unknown 4 ...
87 Catuna Stone 10 ...
88 Malina Stone 8 ...
21. SQL
21
-- Create table
CREATE TABLE Lakes(
Id int IDENTITY (1,1),
Name nvarchar(50),
Location geometry)
-- Insert lake
INSERT INTO Lakes(Name, Location) VALUES(
'Morun',
geometry::STGeomFromText(
'POLYGON ((0 0, 150 0, 150 150, 0 150, 0 0))', 0))
-- Update lake geometry
UPDATE Lakes
SET Location = geometry::STGeomFromText(
'POLYGON ((0 0, 150 0, 150 150, 75 200, 0 150, 0 0))', 0)
WHERE Name = 'Morun'
22. SHOW THE RESULTS
22
-- Get the lake
SELECT Id, Name, Location FROM LAKES WHERE Name = ‘Morun’
Results
Spatial results
23. SQL SERVER MANAGEMENT STUDIO
23
SELECT SHAPE FROM COUNTIES
1. The table
2. The query
3. The results
24. GEOMETRY METHODS
24
-- Get hotel’s location
DECLARE @hotelLocation geometry
SET @hotelLocation = (SELECT hotel.Address
FROM Hotels as hotel
WHERE hotel.Id = 2)
-- Get all lakes within 20 km
SELECT Name,Location
FROM Lakes
WHERE (Location.STDistance(@hotelLocation) <= 20000
Calculate distance
between a lake and a hotel
25. ENTITY FRAMEWORK 5.0
25
// Get hotel's location
var hotel = db.Hotels.Single(hotel => hotel.Id == 2);
// Get all lakes within 20 km range
var lakes = from lake in db.Lakes
where lake.Location.Distance(hotel.Location) <= 20000
select lake
public class Hotel
{
public Int32 Id;
public String Name;
public Int32 NumberOfRooms;
public DBGeometry Location;
}
public class Lake
{
public Int32 Id;
public String Name;
public DBGeometry Location;
}
Query using LINQ
Hotel class Lake class
26. HOW TO STORE A CAR ACCIDENT POSITION?
26
http://www.flickr.com/photos/mac_filko/3925880444/
27. LINEAR REFERENCING
27
Km 46
Id RoadId Description M
45 234 Big accident 40.5
46 462 … 234
48 563 … 100
… … … …
Accidents table
Road E 85
28. HOW TO STORE ROAD SPEED LIMITS?
28
http://flickrhivemind.net/
30. MORE OPEN QUESTIONS
30
• Q: What was the quality of Iasi-Botosani road from 2000
until now?
• A: Archiving
• Q: How can we ensure that there are no gaps between
Iasi and Vaslui counties?
• A: Spatial Data Integrity
• Q: How do we reach to National Arena from Iasi?
• A: Network Analyst
31. FOR ALL THE REST THERE‘S GEODATABASE
31
A geodatabase is a database with extensions for storing,
querying, and manipulating geographic information.
System Tables User Defined
Tables
33. WHAT IS A LAYER?
33
A layer is a collection of
spatial elements that
share the same attributes,
the same geometry type.
Id Name Attribute Shape
… … … …
… … … …
… … … …
… … … …
34. WHAT IS A LAYER?
34
A layer is a collection of spatial
elements that share the same
attributes, the same geometry
type and share symbols,
etiquettes and scales.
42. GIS SERVICES
Mapping Services
Serves cached and
dynamic maps.
Feature Services
Serves features and
simbology.
Network Analyst
Performs analysis
such as routing,
closest facility etc.
Geometry Services
Provides geometric
calculation such as
distance, buffer etc.
Geoprocessing Services
Provides spatial
analysis and data
processing services.
Geocode Services
Finds address
locations.
52. HELLO WORLD ... THE CODE
//JavaScript ...
var map = new esri.Map("map");
//Add the topographic layer to the map
var baseLayer = new
esri.layers.ArcGISTiledMapServiceLayer("http://...");
map.addLayer(baseLayer);
<-- HTML ... >
<div id="map" style="…">
<div style="…">Hello<div>
</div>
55. WHAT IS A WEB MAP APPLICATION?
55
2 Integrated into a web application
3 That users interact with
4 To accomplish meaningful tasks
1 One or more map services
57. WHAT MAKES WEB MAP APP TO BE GREAT?
57
2
Fast
3
Up to date
4
Great cartography and multi scale
1
Easy to use and understand
5
Informative and useful
58. TWO TYPES OF DATA ORGANIZATION
58
Geographic frame of reference
Static data
Reusable in multiple applications
Show a focused item of interest
Editable data
Displayed on top of a basemap
Basemaps Operational Layers
67. WHAT FOR TO USE?
67
Frequently changing data
Real-time data
Complex geometries
Road Traffic
Map
Forecast Map
Heat Map
68. DYNAMIC MAPS PRO‘S AND CON‘S
68
Reflects the actual data
No need to maintain caches
Slower than caching
Need for server resources
Trade quality for performance
2
3
4
1
5
70. WHAT TO USE FOR?
70
Interactive maps
Web editing
Query data
Parcel Query
Popup Info
Parcel Editor
71. GRAPHICS PRO‘S AND CON‘S
71
2
3
4
1
5
Nice user experience
Off-load the work from the server
The “pressure” is on the client
Limited number of features
Lower quality