SlideShare a Scribd company logo
1 of 34
GIS Solution
With Open-Source GIS Solutions
Geoserver
QGIS
Openlayers
Prepared By : Keshav Sharma www.keshavsharma.ml
Pre-Requisites
 Geoserver with Jetty Web Server (2.15.1 Latest)
 SQL Server with SQL Server Management Studio
 NodeJS
 JAVA JDK(have JRE embedded) and JRE 8+
 Visual Studio (Any version) as Code IDE
 QGIS 3
 Shape2SQL / GDAL
 USA Zip ShapeData
 Openlayer3 CLI-npm
Prepared By : Keshav Sharma www.keshavsharma.ml
Geoserver Section Hierarchy
Geoserver
Workspace 1
Store 1.1
Layer 1.1
Layer 1.2
Layer 1.x
Workspace 2
Store 2.1
Layer 2.1
Layer 2.2
Layer 2.x
Workspace X
Store X.1
Store X.2
Store X.3
Prepared By : Keshav Sharma www.keshavsharma.ml
Geoserver
 Go to :http://localhost:8080/geoserver/web
 Login with your credentials: Default Being:
UserID: admin
Password:geoserver
 In Geoserver we have 3 major sections:
1. Workspaces
2. Stores
3. Layers
 Workspaces : This section is the home of all the activities and every Geo-
related object is added and manipulated inside this section.
This wraps the Layers and data-stores under one roof.
Each workspace can have one or more sources and multiple layers.
Prepared By : Keshav Sharma www.keshavsharma.ml
Geoserver
 Stores : This section deals with Shape data which will be rendered and
processed by Geoserver.
A Store can be a Database (SQL Server, POSTGIS, Oracle, etc.) or
It can be a File Based Data (ESRI Shapefile). This is the fuel for Geoserver.
A Store is a collection of Layers
 Layers : This section is the basic unit of Shape Hierarchy.
It is the actual DataTable or ShapeFile which contains geometry data and will
be rendered and processed by Geoserver at elementary level.
This section actually is the basis of Projection of Geometry Data in form of 2D
Vector/Tiled/ Image data.
Prepared By : Keshav Sharma www.keshavsharma.ml
Geoserver : Creating Workspace
 Go to Data->Workspaces -> Add New Workspace
 Enter the Workspace Name (Any String depicting your workspace)
 Enter Namespace URI – Any URI corresponding to Workspace we are creating
for. If you don’t have any URI u can just enter a simple String in this section
Prepared By : Keshav Sharma www.keshavsharma.ml
Geoserver : Creating Store
 Go To : Data-> Stores->Add New Store
 Select the Data-Source you are interested in:
 By default, Only PostGIS is supported. For SQL Server, we need to add
Plugin(explained in later slides)
Prepared By : Keshav Sharma www.keshavsharma.ml
Connect To DB
 We have out-of-the-box support for POSTGRE in Geoserver but we can also add support to MS
SQL Server with official supported Plugins “Microsoft JDBC Connection Plugins”.
 We need to get spatial data for Polygon shape and Datadots
 Installing the SQL Server extension
 GeoServer files
 Download the SQL Server extension from the GeoServer download page.
 Warning Make sure to match the version of the extension to the version of the GeoServer
instance!
 Extract the contents of the archive into the WEB-INF/lib directory of the GeoServer
installation.
 Restart the GeoServer to load the extension.
 Microsoft files
 Navigate to the download page for Microsoft JDBC Drivers for SQL Server.
 Extract the contents of the archive.
 Copy the file sqljdbc4.jar to the WEB-INF/lib directory of the GeoServer installation.
 If GeoServer is installed on Windows, additionally copy authx86sqljdbc_auth.dll and
xax86sqljdbc_xa.dll to C:WindowsSystem32.
Prepared By : Keshav Sharma www.keshavsharma.ml
Connect to DB continued
 So if all steps are followed properly, we will see SQL Server option in
Geoserver ->New Stores -> Microsoft SQL Server
Prepared By : Keshav Sharma www.keshavsharma.ml
Connect to SQL-DB
 Basic Store Infos:
Select the Workspace from the dropdown box
Data Source Name : Database of SQL Server having Geometry Data
 Connection Parameters:
dbtype* : sqlserver (auto-populated)
host* : localhost (if your SQL Server and Geoserver are on same
machine)
else, enter the IP address of the sql-server.
Port : 1433 (Default Port Used by SQL Server. Remember to open
TCP/IP connection for SQL Server in “SQL Server Configuration
Setting”.
Database : blank
Schema : blank
User* : sql login userID
passwd : sql login password
* means mandatory field
Prepared By : Keshav Sharma www.keshavsharma.ml
Connect to SQL DB ….. continued
Prepared By : Keshav Sharma www.keshavsharma.ml
Adding Layer in Geoserver
 Select Layers from left navigation panel
 Select “Add Layers”->select “Workspace:Store” from dropdown.
 On selecting desired store, you will see all the tables available in the
Database you are targeting. (Screenshot for reference).
Prepared By : Keshav Sharma www.keshavsharma.ml
Adding Layer in Geoserver …… Continued
 On clicking on Publish, you will be redirected to “Edit Layer” page.
 Only Bounding Boxes needs to be
tickled a bit, rest configuration is
kept as it is.
 Click on “Compute from Data” to
compute “Native Bounding Boxes”.
 Again click on “Compute from
native bounds” to compute
“Lat/Lon Bounding Box”.
 Finally, click on
Save button at the
bottom and
You are done.
 Now you can see your
published Layer in
Layers section.
Prepared By : Keshav Sharma www.keshavsharma.ml
Geoserver : Layer Preview
 Go to “Data”->Layer Preview.
 You will get a list of Layers which are published on Geoserver till now.
 You can click on Openlayers to have a rendered preview of your published
layer
Output formats supported by Openlayer. You can
also get shapefile from the published Layer
Prepared By : Keshav Sharma www.keshavsharma.ml
Troubleshooting
 Sometimes, on clicking Openlayers in “Layer Preview Section” you will get
some “wms” file downloaded with no extension. This means there is some
problem with Layers.
 The most obvious problem can be default style definition.
 To fix this: Go to Layers->select layer having issue. This will open Edit Layer
Page.
 Select “Publishing” Tab. Scroll down to WMS Setting-> Layer Setting.
 There You will see default style as “generic”.
 Change it to “Giant Polygon” or your custom created SLD file from QGIS.
 Hurray… Issue is fixed. Now you can go to preview layer and selecting
openlayer will give you rendered view of ShapeData.
Prepared By : Keshav Sharma www.keshavsharma.ml
Troubleshooting… Continued
 Now you will se something like this:
Prepared By : Keshav Sharma www.keshavsharma.ml
Few tips to remember……..
 You have to open TCP/IP connectivity and port (say, 1433) from SQL
configuration Tool Manager.
 Do remember to place the jar files(explained in previous slide) before
proceeding.
 A point to remember : Vectors layers are feature layers.
 If encountered with CORS error, just refer next slide for resolution.
 Do remember to update Java.exe path in Startup.bat file and change port
from 8080 to anything like 8899 if 8080 is already occupied.
Prepared By : Keshav Sharma www.keshavsharma.ml
Changing Default Port in Geoserver - The
way I Did: for v2.10 or above
 Open Start.ini in the root directory of Geoserver installation
 Search for 8080 and replace it by desired Port(greater that 1024), say 8899.
 Similarly go to bin/start.bat and perform same replacement of 8080 with
8899.
 Now restart the Geoserver and Go to:
https://localhost:8899/web/geoserver
https://<local-ipaddress>:8899/web/geoserver
Prepared By : Keshav Sharma www.keshavsharma.ml
CORS Error - Resolved
 You might face CORS related error while getting the GeoJSON Data or feature
layer. To rectify this:
Go to : C:Program Files (x86)GeoServer 2.15.0webappsgeoserverWEB-
INFweb.xml.
 You will see commented code as below, just uncomment it and you are done.
 <!-- Uncomment following filter to enable CORS <filter> <filter-name>cross-
origin</filter-name> <filter-
class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> <init-param>
<param-name>chainPreflight</param-name> <param-value>false</param-
value> </init-param> <init-param> <param-
name>allowedOrigins</param-name> <param-value>*</param-value>
</init-param> <init-param> <param-name>allowedMethods</param-
name> <param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value>
</init-param> <init-param> <param-name>allowedHeaders</param-
name> <param-value>*</param-value> </init-param> </filter> -->
Prepared By : Keshav Sharma www.keshavsharma.ml
Tips Continued (Only if any issue occurred)
 Install the JRE according to the instructions included with the release.*
 Set an environment variable JAVA_HOME to the pathname of the directory into which you installed the JDK.
 (1) Download and install the GeoServer binaryThere is more help available at the GeoServer home page (http://geoserver.org) *
Download a binary distribution of GeoServer
 For the purposes of the remainder of this document, the symbolic name GEOSERVER_HOME is used to refer to the directory
where GeoServer resides.
 (2) Start Up GeoServerThere are two techniques by which GeoServer can be started:*
 Use an environment variable: - Set an environment variable GEOSERVER_HOME to the path of the directory into which you
have installed GeoServer. -
Execute the shell command:
Windows: %GEOSERVER_HOME%binstartup
UNIX: $GEOSERVER_HOME/bin/startup.sh*
 Modify your current working directory: - Execute the following shell commands:
Windows: cd %GEOSERVER_HOME%bin startup
UNIX: cd $GEOSERVER_HOME/bin ./startup.sh
 After startup, the default web administration tool included with GeoServer will be available by browsing:
http://localhost:8080/
 (3) Troubleshooting : There are two common problems encountered when attempting to use the binary distribution of
GeoServer:
(a) Another web server (or other process) is already using port 8080. This is the default HTTP port that GeoServer attempts
to bind to at startup.
 (4) Further informationFor more information about configuring and running GeoServer, please see the GeoServer web site:
http://geoserver.org/
Prepared By : Keshav Sharma www.keshavsharma.ml
QGIS
 QGIS is a open-source desktop application supporting Geospatial data
rendering and other Spatial Operations.
 You can use “Browser” to Open and
Render ShapeData.
 You can use File System to open .shp
files. (eg., C:/, D:/)
 Or you can use DB connection (eg.,
SQL, Oracle, POSTGIS) to fetch the
ShapeData from DB.
 To connect to SQL, you need to enter:
1. Name: Any String to name the
Connection.
2. Host: SQLServer Name or IP of the server.
3 .User ID and Password: SQL User credentials
Prepared By : Keshav Sharma www.keshavsharma.ml
How to create SQL-Connection in QGIS
Prepared By : Keshav Sharma www.keshavsharma.ml
Rendering Shape Data on QGIS
 Once the connection to SQL Geo-Database is successful we can simply Add the
Geo-Table as a layer in QGIS and it will start rendering in the View-Space.
Prepared By : Keshav Sharma www.keshavsharma.ml
Rendering Shape Data on QGIS
 You can also use ESRI shapefile (.shp) and render it in QGIS
Prepared By : Keshav Sharma www.keshavsharma.ml
What we have achieved till now….
 Installing and setting up Geoserver and QGIS with SQL server as Geo-
DB
 Connecting Geoserver to SQL Server
 Creating Workspace->Stores->Layers in Geoserver
 Publishing Shape Data to Geoserver and previewing in Layer Preview.
 Connecting QGIS to SQL Server and File System(out-of-the-box
support)
 Rendering Shape Data on QGIS using :
Geodata from DB.
Geodata from ESRI-ShapeFile.
Prepared By : Keshav Sharma www.keshavsharma.ml
Dissolving Layers in QGIS
 Dissolving is a process of clubbing different divisions of shape into single one
on a specific dissolve criteria.
 We can have a layer of State created from District layer by dissolving on the
basis of StateName. For Example, All districts of Goa will be having a column
“State Name” as Goa and hence on dissolving on “State Name” basis we will
get a single shape of Goa.
 So in this way we can create multiple layers of different levels, say town,
city, districts, states, country, continents, world.
Prepared By : Keshav Sharma www.keshavsharma.ml
Dissolving Layers in QGIS ……. continued
 First select the layer you want to dissolve.
 Go To: Vector Tab -> Geoprocessing Tools -> Dissolve
 A dissolve dialog box will appear.
 Select the input layer:
indiandistricts
 Uncheck Dissolve All
 Select Unique ID field:
State(field which is criteria
for dissolve)
 Select output path and you
are done.
Prepared By : Keshav Sharma www.keshavsharma.ml
Styling Layers in GeoServer: Symbology
 Go to : Right Click on Layer you want to add style to.
 Select “Style” in the Layer Properties.
 Change dropdown from “Single Symbol”
to “Categorized”.
 Select “Column” value to categorize the
shape-data. I used State Name for this.
 Click on Classify and Random colors will
be assigned to each distinct State name.
 To save this, click on Save Style and it in
.sld format. This format will be fed to
Geoserver as style.
Prepared By : Keshav Sharma www.keshavsharma.ml
Styling Layers in GeoServer: Symbology
 This sld file will be consumed in Geoserver.
 I saved it as StyleDemo.sld
 Go to : Data-> Style-> Add New Style -> Upload a style file
 Select Workspace and select “sld” style file.
 I will select StyleDemo.sld and it will auto-populate the Name.
 At the bottom, Apply and submit.
 Now select the newly created style ad go to “Publishing” and select
the layer for which you want to add style to. You are Done.
Below is the layer with our created style.
Prepared By : Keshav Sharma www.keshavsharma.ml
Shape to SQL and Vice Versa
 You can convert shape files to Datatables in SQL Server and vice versa by
below mentioned tools:
 Shape2SQL :Untested CommandLine support.
https://www.sharpgis.net/page/shape2sql
 Ogr2Ogr : Bundled with QGIS and most stable among all. It is a command line
tool.
https://www.npmjs.com/package/ogr2ogr
If you have QGIS installed, you will have ogr2ogr.exe in bin folder og QGIS
installation. For me it was present @ C:Program FilesQGIS Brightonbin
Prepared By : Keshav Sharma www.keshavsharma.ml
Shape to SQL and Vice Versa… Continued
 SQL to Shape
 ogr2ogr -f "ESRI Shapefile" “<shape file fully qualifying name>" "MSSQL:server=<SQL Server IP or
Name>;database=<Database Name>;trusted_connection=yes;"-sql “<Select cols1,cols2,etc from
tablename>” -overwrite
 Example 1:
ogr2ogr -f "ESRI Shapefile" "C:tempx.shp" " Server" -sql "SELECT
ogr_fid,oMSSQL:server=Keshav/sqlexpress;database=webPortal;trusted_connection=yes;driver=SQLgr
_geometry,dst_id,district,state FROM indianstates" -overwrite
 Example 2:
ogr2ogr -f "ESRI Shapefile" "C:tempx.shp"
"MSSQL:server=Keshavsqlexpress;database=geoDatabase;trusted_connection=yes;driver=SQL Server"
-sql "SELECT OBJECTID, Shape, ZIP, PO_NAME, STATE, SUMBLKPOP, POP2008,POP08_SQMI, SQMI,
POSTCODE FROM US_ZIP_POLYGON" –overwrite
---------------------------------------------------------------------------------------------------------------------------
 Shape to SQL
 ogr2ogr -f "MSSQLSpatial"
"MSSQL:server=<SERVERNAME>;database=<DATABASENAME>;trusted_connection=yes;driver=SQL
Server" "D:TempMWAYS.shp" -overwrite -SkipFailures -nln "UK_Motorways" -lco PRECISION=NO -
progress
Prepared By : Keshav Sharma www.keshavsharma.ml
Join in QGIS
 You can Join metadata to spatial data-tables.
 For example, You can add more column on the Spatial Data table using join on
particular key( column value).
 Thereafter we can use particular Column to Dissolve Shape.
 Like, dissolve the district layer on the basis of states to get the State spatial
data.
Prepared By : Keshav Sharma www.keshavsharma.ml
Congratulations……..
 So Now we have achieved basic functionality of Geoserver, QGIS and how to
utilize it for Map Creation
 We can now:
 Create dissolved Layers
 Add styles to layers
 Publish map to geoserver.
 If you found this Helpful. Please give a thumps up. It will motivate us to do
more stuff like this.
Prepared By : Keshav Sharma www.keshavsharma.ml
Prepared By : Keshav Sharma www.keshavsharma.ml

More Related Content

What's hot

SQL Track: Restoring databases with powershell
SQL Track: Restoring databases with powershellSQL Track: Restoring databases with powershell
SQL Track: Restoring databases with powershellITProceed
 
Scaling Twitter 12758
Scaling Twitter 12758Scaling Twitter 12758
Scaling Twitter 12758davidblum
 
Rally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupRally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupAnanth Padmanabhan
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cuzzal basak
 
Pluggable database tutorial 2
Pluggable database tutorial 2Pluggable database tutorial 2
Pluggable database tutorial 2Osama Mustafa
 
New Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP ConnectorsNew Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP Connectorsrtretola
 
Common schema my sql uc 2012
Common schema   my sql uc 2012Common schema   my sql uc 2012
Common schema my sql uc 2012Roland Bouman
 

What's hot (11)

SQL Track: Restoring databases with powershell
SQL Track: Restoring databases with powershellSQL Track: Restoring databases with powershell
SQL Track: Restoring databases with powershell
 
fast_bitcoin_data_mining
fast_bitcoin_data_miningfast_bitcoin_data_mining
fast_bitcoin_data_mining
 
SQL Server vs Postgres
SQL Server vs PostgresSQL Server vs Postgres
SQL Server vs Postgres
 
Scaling Twitter 12758
Scaling Twitter 12758Scaling Twitter 12758
Scaling Twitter 12758
 
Rally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetupRally - Benchmarking_as_a_service - Openstack meetup
Rally - Benchmarking_as_a_service - Openstack meetup
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
Pluggable database tutorial 2
Pluggable database tutorial 2Pluggable database tutorial 2
Pluggable database tutorial 2
 
New Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP ConnectorsNew Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP Connectors
 
Common schema my sql uc 2012
Common schema   my sql uc 2012Common schema   my sql uc 2012
Common schema my sql uc 2012
 
Oracle11g notes
Oracle11g notesOracle11g notes
Oracle11g notes
 

Similar to Geoserver GIS Mapping Solution

Dspace for windows
Dspace for windowsDspace for windows
Dspace for windowsRavi Bankar
 
Java EE 02-First Servlet
Java EE 02-First ServletJava EE 02-First Servlet
Java EE 02-First ServletFernando Gil
 
AllegroCache with Web Servers
AllegroCache with Web ServersAllegroCache with Web Servers
AllegroCache with Web Serverswebhostingguy
 
3 Easy Steps to Install Docker PostgreSQL Environment.pdf
3 Easy Steps to Install Docker PostgreSQL Environment.pdf3 Easy Steps to Install Docker PostgreSQL Environment.pdf
3 Easy Steps to Install Docker PostgreSQL Environment.pdfcalfonzodaly
 
Practical Installation Process Of New Gen Lib Oss On Windows Xp For Library A...
Practical Installation Process Of New Gen Lib Oss On Windows Xp For Library A...Practical Installation Process Of New Gen Lib Oss On Windows Xp For Library A...
Practical Installation Process Of New Gen Lib Oss On Windows Xp For Library A...Goutam Biswas
 
Install NewGenLib on Windows XP
Install NewGenLib on Windows XPInstall NewGenLib on Windows XP
Install NewGenLib on Windows XPRupesh Kumar
 
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Jade Global
 
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Jade Global
 
Installation Process Of New Gen Lib Oss On Windows Xp For Library Automation ...
Installation Process Of New Gen Lib Oss On Windows Xp For Library Automation ...Installation Process Of New Gen Lib Oss On Windows Xp For Library Automation ...
Installation Process Of New Gen Lib Oss On Windows Xp For Library Automation ...Goutam Biswas
 
Content server installation guide
Content server installation guideContent server installation guide
Content server installation guideNaveed Bashir
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments Ohad Raz
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular applicationmirrec
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySqlkamal kotecha
 
Docker Java App with MariaDB – Deployment in Less than a Minute
Docker Java App with MariaDB – Deployment in Less than a MinuteDocker Java App with MariaDB – Deployment in Less than a Minute
Docker Java App with MariaDB – Deployment in Less than a Minutedchq
 
Install Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle LinuxInstall Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle LinuxArun Sharma
 
Installing Hortonworks Hadoop for Windows
Installing Hortonworks Hadoop for WindowsInstalling Hortonworks Hadoop for Windows
Installing Hortonworks Hadoop for WindowsJonathan Bloom
 
configuring+oracle+rds+with+glasfish+server
configuring+oracle+rds+with+glasfish+serverconfiguring+oracle+rds+with+glasfish+server
configuring+oracle+rds+with+glasfish+serverhunghtc83
 

Similar to Geoserver GIS Mapping Solution (20)

Dspace for windows
Dspace for windowsDspace for windows
Dspace for windows
 
Java EE 02-First Servlet
Java EE 02-First ServletJava EE 02-First Servlet
Java EE 02-First Servlet
 
AllegroCache with Web Servers
AllegroCache with Web ServersAllegroCache with Web Servers
AllegroCache with Web Servers
 
3 Easy Steps to Install Docker PostgreSQL Environment.pdf
3 Easy Steps to Install Docker PostgreSQL Environment.pdf3 Easy Steps to Install Docker PostgreSQL Environment.pdf
3 Easy Steps to Install Docker PostgreSQL Environment.pdf
 
Newgenlib
NewgenlibNewgenlib
Newgenlib
 
Newgenlib
NewgenlibNewgenlib
Newgenlib
 
Practical Installation Process Of New Gen Lib Oss On Windows Xp For Library A...
Practical Installation Process Of New Gen Lib Oss On Windows Xp For Library A...Practical Installation Process Of New Gen Lib Oss On Windows Xp For Library A...
Practical Installation Process Of New Gen Lib Oss On Windows Xp For Library A...
 
Install NewGenLib on Windows XP
Install NewGenLib on Windows XPInstall NewGenLib on Windows XP
Install NewGenLib on Windows XP
 
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
 
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
Demantra Installation,Configuration and Integration with EBusiness Suite R12.1.1
 
Installation Process Of New Gen Lib Oss On Windows Xp For Library Automation ...
Installation Process Of New Gen Lib Oss On Windows Xp For Library Automation ...Installation Process Of New Gen Lib Oss On Windows Xp For Library Automation ...
Installation Process Of New Gen Lib Oss On Windows Xp For Library Automation ...
 
Content server installation guide
Content server installation guideContent server installation guide
Content server installation guide
 
WordPress Development Environments
WordPress Development Environments WordPress Development Environments
WordPress Development Environments
 
Rails Engine | Modular application
Rails Engine | Modular applicationRails Engine | Modular application
Rails Engine | Modular application
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySql
 
Docker Java App with MariaDB – Deployment in Less than a Minute
Docker Java App with MariaDB – Deployment in Less than a MinuteDocker Java App with MariaDB – Deployment in Less than a Minute
Docker Java App with MariaDB – Deployment in Less than a Minute
 
Install Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle LinuxInstall Oracle 12c Golden Gate On Oracle Linux
Install Oracle 12c Golden Gate On Oracle Linux
 
D Space Installation
D Space InstallationD Space Installation
D Space Installation
 
Installing Hortonworks Hadoop for Windows
Installing Hortonworks Hadoop for WindowsInstalling Hortonworks Hadoop for Windows
Installing Hortonworks Hadoop for Windows
 
configuring+oracle+rds+with+glasfish+server
configuring+oracle+rds+with+glasfish+serverconfiguring+oracle+rds+with+glasfish+server
configuring+oracle+rds+with+glasfish+server
 

Recently uploaded

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Boksburg [(+27832195400*)] 🏥 Women's Abortion Clinic in ...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 

Geoserver GIS Mapping Solution

  • 1. GIS Solution With Open-Source GIS Solutions Geoserver QGIS Openlayers Prepared By : Keshav Sharma www.keshavsharma.ml
  • 2. Pre-Requisites  Geoserver with Jetty Web Server (2.15.1 Latest)  SQL Server with SQL Server Management Studio  NodeJS  JAVA JDK(have JRE embedded) and JRE 8+  Visual Studio (Any version) as Code IDE  QGIS 3  Shape2SQL / GDAL  USA Zip ShapeData  Openlayer3 CLI-npm Prepared By : Keshav Sharma www.keshavsharma.ml
  • 3. Geoserver Section Hierarchy Geoserver Workspace 1 Store 1.1 Layer 1.1 Layer 1.2 Layer 1.x Workspace 2 Store 2.1 Layer 2.1 Layer 2.2 Layer 2.x Workspace X Store X.1 Store X.2 Store X.3 Prepared By : Keshav Sharma www.keshavsharma.ml
  • 4. Geoserver  Go to :http://localhost:8080/geoserver/web  Login with your credentials: Default Being: UserID: admin Password:geoserver  In Geoserver we have 3 major sections: 1. Workspaces 2. Stores 3. Layers  Workspaces : This section is the home of all the activities and every Geo- related object is added and manipulated inside this section. This wraps the Layers and data-stores under one roof. Each workspace can have one or more sources and multiple layers. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 5. Geoserver  Stores : This section deals with Shape data which will be rendered and processed by Geoserver. A Store can be a Database (SQL Server, POSTGIS, Oracle, etc.) or It can be a File Based Data (ESRI Shapefile). This is the fuel for Geoserver. A Store is a collection of Layers  Layers : This section is the basic unit of Shape Hierarchy. It is the actual DataTable or ShapeFile which contains geometry data and will be rendered and processed by Geoserver at elementary level. This section actually is the basis of Projection of Geometry Data in form of 2D Vector/Tiled/ Image data. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 6. Geoserver : Creating Workspace  Go to Data->Workspaces -> Add New Workspace  Enter the Workspace Name (Any String depicting your workspace)  Enter Namespace URI – Any URI corresponding to Workspace we are creating for. If you don’t have any URI u can just enter a simple String in this section Prepared By : Keshav Sharma www.keshavsharma.ml
  • 7. Geoserver : Creating Store  Go To : Data-> Stores->Add New Store  Select the Data-Source you are interested in:  By default, Only PostGIS is supported. For SQL Server, we need to add Plugin(explained in later slides) Prepared By : Keshav Sharma www.keshavsharma.ml
  • 8. Connect To DB  We have out-of-the-box support for POSTGRE in Geoserver but we can also add support to MS SQL Server with official supported Plugins “Microsoft JDBC Connection Plugins”.  We need to get spatial data for Polygon shape and Datadots  Installing the SQL Server extension  GeoServer files  Download the SQL Server extension from the GeoServer download page.  Warning Make sure to match the version of the extension to the version of the GeoServer instance!  Extract the contents of the archive into the WEB-INF/lib directory of the GeoServer installation.  Restart the GeoServer to load the extension.  Microsoft files  Navigate to the download page for Microsoft JDBC Drivers for SQL Server.  Extract the contents of the archive.  Copy the file sqljdbc4.jar to the WEB-INF/lib directory of the GeoServer installation.  If GeoServer is installed on Windows, additionally copy authx86sqljdbc_auth.dll and xax86sqljdbc_xa.dll to C:WindowsSystem32. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 9. Connect to DB continued  So if all steps are followed properly, we will see SQL Server option in Geoserver ->New Stores -> Microsoft SQL Server Prepared By : Keshav Sharma www.keshavsharma.ml
  • 10. Connect to SQL-DB  Basic Store Infos: Select the Workspace from the dropdown box Data Source Name : Database of SQL Server having Geometry Data  Connection Parameters: dbtype* : sqlserver (auto-populated) host* : localhost (if your SQL Server and Geoserver are on same machine) else, enter the IP address of the sql-server. Port : 1433 (Default Port Used by SQL Server. Remember to open TCP/IP connection for SQL Server in “SQL Server Configuration Setting”. Database : blank Schema : blank User* : sql login userID passwd : sql login password * means mandatory field Prepared By : Keshav Sharma www.keshavsharma.ml
  • 11. Connect to SQL DB ….. continued Prepared By : Keshav Sharma www.keshavsharma.ml
  • 12. Adding Layer in Geoserver  Select Layers from left navigation panel  Select “Add Layers”->select “Workspace:Store” from dropdown.  On selecting desired store, you will see all the tables available in the Database you are targeting. (Screenshot for reference). Prepared By : Keshav Sharma www.keshavsharma.ml
  • 13. Adding Layer in Geoserver …… Continued  On clicking on Publish, you will be redirected to “Edit Layer” page.  Only Bounding Boxes needs to be tickled a bit, rest configuration is kept as it is.  Click on “Compute from Data” to compute “Native Bounding Boxes”.  Again click on “Compute from native bounds” to compute “Lat/Lon Bounding Box”.  Finally, click on Save button at the bottom and You are done.  Now you can see your published Layer in Layers section. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 14. Geoserver : Layer Preview  Go to “Data”->Layer Preview.  You will get a list of Layers which are published on Geoserver till now.  You can click on Openlayers to have a rendered preview of your published layer Output formats supported by Openlayer. You can also get shapefile from the published Layer Prepared By : Keshav Sharma www.keshavsharma.ml
  • 15. Troubleshooting  Sometimes, on clicking Openlayers in “Layer Preview Section” you will get some “wms” file downloaded with no extension. This means there is some problem with Layers.  The most obvious problem can be default style definition.  To fix this: Go to Layers->select layer having issue. This will open Edit Layer Page.  Select “Publishing” Tab. Scroll down to WMS Setting-> Layer Setting.  There You will see default style as “generic”.  Change it to “Giant Polygon” or your custom created SLD file from QGIS.  Hurray… Issue is fixed. Now you can go to preview layer and selecting openlayer will give you rendered view of ShapeData. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 16. Troubleshooting… Continued  Now you will se something like this: Prepared By : Keshav Sharma www.keshavsharma.ml
  • 17. Few tips to remember……..  You have to open TCP/IP connectivity and port (say, 1433) from SQL configuration Tool Manager.  Do remember to place the jar files(explained in previous slide) before proceeding.  A point to remember : Vectors layers are feature layers.  If encountered with CORS error, just refer next slide for resolution.  Do remember to update Java.exe path in Startup.bat file and change port from 8080 to anything like 8899 if 8080 is already occupied. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 18. Changing Default Port in Geoserver - The way I Did: for v2.10 or above  Open Start.ini in the root directory of Geoserver installation  Search for 8080 and replace it by desired Port(greater that 1024), say 8899.  Similarly go to bin/start.bat and perform same replacement of 8080 with 8899.  Now restart the Geoserver and Go to: https://localhost:8899/web/geoserver https://<local-ipaddress>:8899/web/geoserver Prepared By : Keshav Sharma www.keshavsharma.ml
  • 19. CORS Error - Resolved  You might face CORS related error while getting the GeoJSON Data or feature layer. To rectify this: Go to : C:Program Files (x86)GeoServer 2.15.0webappsgeoserverWEB- INFweb.xml.  You will see commented code as below, just uncomment it and you are done.  <!-- Uncomment following filter to enable CORS <filter> <filter-name>cross- origin</filter-name> <filter- class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> <init-param> <param-name>chainPreflight</param-name> <param-value>false</param- value> </init-param> <init-param> <param- name>allowedOrigins</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>allowedMethods</param- name> <param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value> </init-param> <init-param> <param-name>allowedHeaders</param- name> <param-value>*</param-value> </init-param> </filter> --> Prepared By : Keshav Sharma www.keshavsharma.ml
  • 20. Tips Continued (Only if any issue occurred)  Install the JRE according to the instructions included with the release.*  Set an environment variable JAVA_HOME to the pathname of the directory into which you installed the JDK.  (1) Download and install the GeoServer binaryThere is more help available at the GeoServer home page (http://geoserver.org) * Download a binary distribution of GeoServer  For the purposes of the remainder of this document, the symbolic name GEOSERVER_HOME is used to refer to the directory where GeoServer resides.  (2) Start Up GeoServerThere are two techniques by which GeoServer can be started:*  Use an environment variable: - Set an environment variable GEOSERVER_HOME to the path of the directory into which you have installed GeoServer. - Execute the shell command: Windows: %GEOSERVER_HOME%binstartup UNIX: $GEOSERVER_HOME/bin/startup.sh*  Modify your current working directory: - Execute the following shell commands: Windows: cd %GEOSERVER_HOME%bin startup UNIX: cd $GEOSERVER_HOME/bin ./startup.sh  After startup, the default web administration tool included with GeoServer will be available by browsing: http://localhost:8080/  (3) Troubleshooting : There are two common problems encountered when attempting to use the binary distribution of GeoServer: (a) Another web server (or other process) is already using port 8080. This is the default HTTP port that GeoServer attempts to bind to at startup.  (4) Further informationFor more information about configuring and running GeoServer, please see the GeoServer web site: http://geoserver.org/ Prepared By : Keshav Sharma www.keshavsharma.ml
  • 21. QGIS  QGIS is a open-source desktop application supporting Geospatial data rendering and other Spatial Operations.  You can use “Browser” to Open and Render ShapeData.  You can use File System to open .shp files. (eg., C:/, D:/)  Or you can use DB connection (eg., SQL, Oracle, POSTGIS) to fetch the ShapeData from DB.  To connect to SQL, you need to enter: 1. Name: Any String to name the Connection. 2. Host: SQLServer Name or IP of the server. 3 .User ID and Password: SQL User credentials Prepared By : Keshav Sharma www.keshavsharma.ml
  • 22. How to create SQL-Connection in QGIS Prepared By : Keshav Sharma www.keshavsharma.ml
  • 23. Rendering Shape Data on QGIS  Once the connection to SQL Geo-Database is successful we can simply Add the Geo-Table as a layer in QGIS and it will start rendering in the View-Space. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 24. Rendering Shape Data on QGIS  You can also use ESRI shapefile (.shp) and render it in QGIS Prepared By : Keshav Sharma www.keshavsharma.ml
  • 25. What we have achieved till now….  Installing and setting up Geoserver and QGIS with SQL server as Geo- DB  Connecting Geoserver to SQL Server  Creating Workspace->Stores->Layers in Geoserver  Publishing Shape Data to Geoserver and previewing in Layer Preview.  Connecting QGIS to SQL Server and File System(out-of-the-box support)  Rendering Shape Data on QGIS using : Geodata from DB. Geodata from ESRI-ShapeFile. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 26. Dissolving Layers in QGIS  Dissolving is a process of clubbing different divisions of shape into single one on a specific dissolve criteria.  We can have a layer of State created from District layer by dissolving on the basis of StateName. For Example, All districts of Goa will be having a column “State Name” as Goa and hence on dissolving on “State Name” basis we will get a single shape of Goa.  So in this way we can create multiple layers of different levels, say town, city, districts, states, country, continents, world. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 27. Dissolving Layers in QGIS ……. continued  First select the layer you want to dissolve.  Go To: Vector Tab -> Geoprocessing Tools -> Dissolve  A dissolve dialog box will appear.  Select the input layer: indiandistricts  Uncheck Dissolve All  Select Unique ID field: State(field which is criteria for dissolve)  Select output path and you are done. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 28. Styling Layers in GeoServer: Symbology  Go to : Right Click on Layer you want to add style to.  Select “Style” in the Layer Properties.  Change dropdown from “Single Symbol” to “Categorized”.  Select “Column” value to categorize the shape-data. I used State Name for this.  Click on Classify and Random colors will be assigned to each distinct State name.  To save this, click on Save Style and it in .sld format. This format will be fed to Geoserver as style. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 29. Styling Layers in GeoServer: Symbology  This sld file will be consumed in Geoserver.  I saved it as StyleDemo.sld  Go to : Data-> Style-> Add New Style -> Upload a style file  Select Workspace and select “sld” style file.  I will select StyleDemo.sld and it will auto-populate the Name.  At the bottom, Apply and submit.  Now select the newly created style ad go to “Publishing” and select the layer for which you want to add style to. You are Done. Below is the layer with our created style. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 30. Shape to SQL and Vice Versa  You can convert shape files to Datatables in SQL Server and vice versa by below mentioned tools:  Shape2SQL :Untested CommandLine support. https://www.sharpgis.net/page/shape2sql  Ogr2Ogr : Bundled with QGIS and most stable among all. It is a command line tool. https://www.npmjs.com/package/ogr2ogr If you have QGIS installed, you will have ogr2ogr.exe in bin folder og QGIS installation. For me it was present @ C:Program FilesQGIS Brightonbin Prepared By : Keshav Sharma www.keshavsharma.ml
  • 31. Shape to SQL and Vice Versa… Continued  SQL to Shape  ogr2ogr -f "ESRI Shapefile" “<shape file fully qualifying name>" "MSSQL:server=<SQL Server IP or Name>;database=<Database Name>;trusted_connection=yes;"-sql “<Select cols1,cols2,etc from tablename>” -overwrite  Example 1: ogr2ogr -f "ESRI Shapefile" "C:tempx.shp" " Server" -sql "SELECT ogr_fid,oMSSQL:server=Keshav/sqlexpress;database=webPortal;trusted_connection=yes;driver=SQLgr _geometry,dst_id,district,state FROM indianstates" -overwrite  Example 2: ogr2ogr -f "ESRI Shapefile" "C:tempx.shp" "MSSQL:server=Keshavsqlexpress;database=geoDatabase;trusted_connection=yes;driver=SQL Server" -sql "SELECT OBJECTID, Shape, ZIP, PO_NAME, STATE, SUMBLKPOP, POP2008,POP08_SQMI, SQMI, POSTCODE FROM US_ZIP_POLYGON" –overwrite ---------------------------------------------------------------------------------------------------------------------------  Shape to SQL  ogr2ogr -f "MSSQLSpatial" "MSSQL:server=<SERVERNAME>;database=<DATABASENAME>;trusted_connection=yes;driver=SQL Server" "D:TempMWAYS.shp" -overwrite -SkipFailures -nln "UK_Motorways" -lco PRECISION=NO - progress Prepared By : Keshav Sharma www.keshavsharma.ml
  • 32. Join in QGIS  You can Join metadata to spatial data-tables.  For example, You can add more column on the Spatial Data table using join on particular key( column value).  Thereafter we can use particular Column to Dissolve Shape.  Like, dissolve the district layer on the basis of states to get the State spatial data. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 33. Congratulations……..  So Now we have achieved basic functionality of Geoserver, QGIS and how to utilize it for Map Creation  We can now:  Create dissolved Layers  Add styles to layers  Publish map to geoserver.  If you found this Helpful. Please give a thumps up. It will motivate us to do more stuff like this. Prepared By : Keshav Sharma www.keshavsharma.ml
  • 34. Prepared By : Keshav Sharma www.keshavsharma.ml