Convert NetCDF to Geotiff

In this article we are going you discuss conversion process of NetCDF to geoTIFF file. Here this conversion is required because many of servers does not directly support NetCDF. You need to install some plug-ins to publish and view the Netcdf data. So it would be better to convert the Netcdf data in geotiff for particular bands so that you do not have to install plugins.

Online Tool to Convert NetCDF to GeoTiff

Convert NetCDF to Geotiff

NetCDF data is a multi-Dimensional data to store large number of bands in one file. There can be various dimensional such as space (Latitude, Longitude and Altitude) and time. In bands you can have information about pressure, temperature, wind direction etc. You can look over in detail of multidimensional data of NetCDF file.

Convert- NetCDF to Geotiff

Convert NetCDF into GeoTiff using gdal utility

For using Gdal utility you need to add gdal in your system. For that you can follow the given commands

Convert- NetCDF to Geotiff

To check the availability of ogr2ogr in system, you can type the command ogr2ogr and get following response

Convert- NetCDF to Geotiff

Now you can follow the given command to convert NetCDF in GeoTiff

–> gdal_translate -a_srs EPSG:4326 NETCDF:File_Name.nc:Band_Name  -of ‘Gtiff’ Output_FileName.geotiff

Here we have used gdal_translate utility of GDAL. It has following options

Convert- NetCDF to Geotiff

Here -a_srs srs_def defines the assignment of SRS (Spatial Reference system) to output file. we have selected EPSG (European Petroleum Survey Group)  4326. You can choose your file’s SRS. The next option is NetCDF file name with a band which needed to be convert in geotiff. The option -of is the Output file format. Here ‘Gtiff’  is geotiff driver in gdal. After this specify the output file name with .geotiff or .tiff extension.

Output Geotiff file- Convert NetCDF to Geotiff

The generated output tiff file can be viewd in QGIS software.

Convert- NetCDF to Geotiff

The output shows one of the band converted into geotiff. It has multiple bands. Similarly you can can convert other file in geotiff like HDF5 to GeoTIFF or Grib to GeoTIFF.

For more information or any help you can comment in given box. We are always available for your help.

Convert GRIB to Geotiff

In this tutorial, we will find out how a can we convert GRIB to GeoTIFF file format. First of all the question is what is GRIB file and why anyone would convert the GRIB file in Geotiff format.

Here is the online Tool to Convert GRIB To GeoTiff

Convert GRIB to GeoTIFF

Before taking to conversion of GRIB and GeoTIFF, lets first understand what is GRIB and What is GeoTIFF.

GRIB (General Regularly-distributed Information in Binary) files are multidimensional files. These files are used to store Meteorological data. The data is store in image mosaic format. That measn all the raster bands ate mosaic together to store in one file. You may also look over details of GRIB Multi dimensional data.

Convert-GRIB to Geotiff

Convert GRIB file in Geotiff using GDAL utility-

Here GDAL Utility (gdal_translate) is used . For using this utility you need to add GDAL in your system. please follow the given command

Convert-GRIB to Geotiff

To check the presence of this library, you can type ogr2ogr in command prompt and get the following output.Convert-GRIB to Geotiff

Now follow the command to convert GRIB in geotiff.

–> gdal_translate -b 354 -a_srs EPSG:4326 GRIB_Filename.grb2 -of Gtiff’ Output_tiffname.geotiff

The options available in gdal_translate utility can be viewed by executing command gdal_translate on command prompt.

Convert-GRIB to Geotiff

Here, in the command we have -a_srs to assign SRS (spatial reference system) , specify the GRIB file. The option -of ‘Gtiff’ shows the output file format.

Output in QGIS software

Convert-GRIB to Geotiff

Here we have more conversion as Netcdf to geotiff, HDF5 to geotiff etc., which can follow to convert your data.

Please feel free to comment in given box for any help.

QGIS2Web – Create Web Maps

Web Mapping  is a service through which the consumers will choose what they want to show on the map. It is a great way to publish your Geographical information system data to their web and make it accessible by the other consumers. web mapping is tightly related to programming and it has a learning curve. GIS users are typically aren’t web programmers and it presents a challenge when one needs to create a web map that is of the same quality as a map creating in a GIS. In this post we will learn how can we use QGIS2Web for creating the web map.

We make maps because we want to send out a message. The great advantage here is when you put your spatial data on a web map as opposed to an offline map, your map is to be seen and you get your message sent to much wider audience. You can just spread out the URL of your web map and have people explore your beautiful maps.

QGIS2Web – Create Web Maps

QGIS2Web is a tool that turns QGIS layers into HTML, JavaScript, and CSS files. QGIS2Web can create an interactive web map that pops up information for the user.

Using Qgis2web is no big deal and it is really very is to use. Let’s start it how and what we can do with Qgis2web.

Creating Map in QGIS – QGIS2Web

    • Go to your QGIS application and click add vector layer, Now browse the Layer from your downloaded project.
      head
    • Now lets just create a map in QGIS. here in this map when a user clicks on a state we would want it to popup the information about it. the information is already present in the attribute table of this layer. Right click on the layer and select properties.
    • For the different attributes present in the layer. Switch to the Fields tab. Some of these aren’t relevant to us for web map, so we can choose to hide these. We will keep admin, region, postal, woe_label, name, longitude, latitude and type fields and hide the others fields. Click on Text Edit button under the Edit widget column for adm1_code field.
    • In the Edit Widget Properties dialog, choose Hidden as the type. Click OK. Do the with all the others.
    • We can also use the Alias column to indicate an alternate name for the fields without actually changing the underlying data table. This is useful to give more user-friendly field names to the users of our map. Add aliases as per your choices and click Ok.
    • Now if we want to show only specific data or area in our web map, Switch to General tab.
    • In General tab now we will build a query in Query builder in Provider feature filter for filtering the data we want to show to the map. So click to Query Builder and then select field by which you want to filter that data and insert the filter value. You can also test your query by clicking Test  button there. Then click OK on both windows.
    • Back in the main QGIS window, choose the Identify tool and click on any point. The Identify Results panel will display the nicely formatted attributes with the newly added aliases. You will notice that the hidden fields do not appear in the results.
    • Now let’s style our layer to be more visually appealing and informative. Right-click the layer and select Properties. Switch to the Style tab. Choose Categorized style and our field Name as the Column. Click Classify.
    • We need to label each State. Switch to the Labels tab in the Properties dialog. Select Show labels for this layer and choose name as the value for Label with. We will also set Rendering option so that the labels only appear when the user is sufficiently zoomed in. Check Scale-based visibility under Label options. Enter 1 as the Minimum scale and 10000000 as the maximum scale. This setting will render the labels only after the user has zoomed in more than 1:10000000 scale and will be visible till 1:1 scale.
    • The map is ready now. Time to save our work go to Project > Save. Enter name of the project you want to give.

    QGIS2WEB Web Mapping

    • Now as our Map is completed and saved. We will use Qgis2web which is a plugin of the QGIS software. You should first install the Qgis2web plugin from inside QGIS. To do that, In QGIS and go to Plugins > Manage and Install Plugins… Then search for qgis2web and click Install plugin.
    • Our QGIS map is now ready to be converted into a HTML map with qgis2web. Qgis2web reads QGIS layers and their style and converts them into HTML, Javascript, and CSS files that can be viewed from the browser.
    •  Once the plugin is installed, we will create a web map, go to Web > qgis2web > Create a web map.
    • In the Export web map dialog, select how you want the popups to be labelled in the web map in upper panel.
    • In the Export to web map dialog, Select Expanded or Collapsed in Add layers list in the bottom panel under the Appearance section. Also select the field for Label search whatever you like to see in your web map. Check the Show popups on hover to allow display of info-windows on hover. We can also set a basemap so the users have more context when looking at the layer. Select OSM B&W to use a black-and-white themed basemap create using OpenStreetMap data. You also have an option to choose from either OpenLayers or Leaflet as the web mapping library. We will restrict this tutorial to use the OpenLayers library. Click Update Preview` to see how your exported map will look like. Before we do the actual export, we need to set the Export folder. You can select a folder of your choice and click Export.
    • Once the export is complete, the default browser for your computer will open and show the interactive web map.
    • OpenLayes and Leaflet libraries ha many functions and operations that we can apply in Qgis2web  but Qgis2web also has some limitations. Here In this post we created a template with Qgis2web by which you can customize the web map. Qgis2web plugin saves a lot of valuable time in web mapping.  The output created from this process can be readily changed to suit your requirement.

    Pressing the Export button in QGIS2Web generates an index.html file and three folders with associated Javascript and CSS files. If you want to publish this map online, you would need to get a web hosting account and simply upload the index.html file and the three associated folders to the main public html directory. Visiting the URL of your website would then show the map in the browser.

ArcGIS FAQs – ArcGIS Interview Question

ArcGIS provides an infrastructure for making maps and geographic information available throughout an organization, across a community, and openly on the Web. Applying location-based analysis to business practices are some of the unique set of capabilities offered by ArcGIS. Here in this post we will check FAQs of ArcGIS and Common Question asked during Interview Question.

ArcGIS Interview Question – Frequently Asked Question ArcGIS

Que. What is ArcGIS?
Ans. ArcGIS is a geographic information system (GIS) for working with maps and geographic information. It is used for creating and using maps, compiling geographic data, analyzing mapped information, sharing and discovering geographic information, using maps and geographic information in a range of applications, and managing geographic information in a database. ArcGIS software—Create and Share Maps, Analytics, and Data.

Que. What is open source software?
Ans. An open source application by definition is software that you can freely access and modify the source code for.
name few open source GIS software
QGIS,gVSIG, Whitebox GAT, SAGA GIS, GRASS GIS, MapWindow, ILWIS, GeoDa, uDig and OpenJump

Que. What is geocoding?
Ans. Geocoding is the process of transforming a description of a location—such as a pair of coordinates, an address, or a name of a place—to a location on the earth’s surface.

Que. What is geodatabase?
Ans. an ArcGIS geodatabase is a collection of geographic datasets of various types held in a common file system folder, a Microsoft Access database, or a multiuser relational DBMS (such as Oracle, Microsoft SQL Server, PostgreSQL, Informix, or IBM DB2).

Que. What is database server?
Ans. A database server is a computer program that provides database services to other computer programs or to computers, as defined by the client–server model.

Que. What is georefrencing ?
Ans. Georeferencing means to associate something with locations in physical space. The term is commonly used in the geographic information systems field to describe the process of associating a physical map or raster image of a map with spatial locations.

Que. What is the purpose of georefrencing?
Ans. The purpose of georeferencing is to turn nonspatial imagery, such as historical air photos or maps, into spatial raster data for use in a variety of circumstances. Spatialized air photos, for example, can be used for GIS land cover analysis or to use as a baselayer on a mobile device While in the field.

Que. What is the use of arcmap?
Ans. ArcMap is the main component of Esri’s ArcGIS suite of geospatial processing programs, and is used primarily to view, edit, create, and analyze geospatial data.ArcMap allows the user to explore data within a data set, symbolize features accordingly, and create maps.

Que. What is shape file?
Ans. The shapefile format is a popular geospatial vector data format for geographic information system (GIS) software. It is developed and regulated by Esri as a (mostly) open specification for data interoperability among Esri and other GIS software products.

Que. What are the extensions of shape file?
Ans. The extensions of shapeFiles are as follows:

.shp is a mandatory Esri file that gives features their geometry. Every shapefile has its own .shp file that represent spatial vector data. For example, it could be points, lines and polygons in a map.

.shx are mandatory Esri and AutoCAD shape index position. This type of file is used to search forward and backwards.

.dbf is a standard database file used to store attribute data and object IDs. A .dbf file is mandatory for shape files. You can open .DBF files in Microsoft Access or Excel.

.prj is an optional file that contains the metadata associated with the shapefiles coordinate and projection system. If this file does not exist, you will get the error “unknown coordinate system”. If you want to fix this error, you have to use the “define projection” tool Which generates .prj files.

.xml file types contains the metadata associated with the shapefile. If you delete this file, you essentially delete your metadata. You can open and edit this optional file type (.xml) in any text editor.

.sbn is an optional spatial index file that optimizes spatial queries. This file type is saved together with a .sbx file. These two files make up a shape index to speed up spatial queries.

.sbx are similar to .sbn files in Which they speed up loading times. It works with .sbn files to optimize spatial queries. We tested .sbn and .sbx extensions and found that there were faster load times When these files existed. It was 6 seconds faster (27.3 sec versus 33.3 sec) compared with/without .sbn and .sbx files.

.cpg are optional plain text files that describes the encoding applied to create the shapefile. If your shapefile doesn’t have a cpg file, then it has the system default encoding.

Que. What extensions does raster file uses?
Ans. there are three files as img, aux and rrd. Img is the image file, aux is auxiliary (AUX or AUX.XML) file accompanies the raster in the same location and stores any auxiliary information that cannot be stored in the raster file itself. And rrd is reduced resolution dataset file created When zooming is required.

Que. What is GIS premitives?
Ans. point, line and polygon.

Que. What is pixel?
Ans. The smallest unit of information in an image or raster map, usually square or rectangular. Pixel is often used synonymously with cell.

Que. What is overlay analysis?
Ans. Overlay is a GIS operation that superimposes multiple data sets (representing different themes) together for the purpose of identifying relationships between them. An overlay creates a composite map by combining the geometry and attributes of the input data sets. Tools are available in most GIS software for overlaying both Vector or raster data.

Que. can we see each pixel value in arcmap software?
Ans. The Pixel Inspector tool is used to view the pixel values of your raster dataset When displayed in ArcMap. 

Que. Name commonly used tools in arcmap for analysis purpose.
Ans. Overlay analysis, Proximity analysis, Table analysis and management, Surface creation and analysis and Selecting and Extracting data.

Que. What extract tool does?
Ans. The Extract tools let you select features and attributes in a feature class or table based on a query (SQL expression) or spatial extraction. The output features and attributes are stored in a feature class or table.

Que. Why we use overlay tool?
Ans. The Overlay toolset contains tools to overlay multiple feature classes to combine, erase, modify, or update spatial features, resulting in a new feature class.

Que. What is feature class?
Ans. In ArcGIS, a collection of geographic features with the same geometry type (such as point, line, or polygon), the same attributes, and the same spatial reference. Featureclasses can be stored in geodatabases, shapefiles, coverages, or other data formats.

Que. Why we use proximity tool?
Ans. The Proximity toolset contains tools that are used to determine the proximity of features within one or more feature classes or between two feature classes. 

Que. Why we use statistics tool?
Ans. The Statistics toolset contains tools that perform standard statistical analysis (such as mean, minimum, maximum, and standard deviation) on attribute data as well as tools that calculate area, length, and count statistics for overlapping and neighboring features.

Que. Why we use conversion tool?
Ans. The Conversion toolbox contains tools that convert data between various formats.

Que. What is iteration?
Ans. repetition of a mathematical or computational procedure applied to the result of a previous application, typically as a means of obtaining successively closer approximations to the solution of a problem.

Que. What to do When a task need to repeat multiple time?
Ans. we can use modelBuilder tool.

Que. What is modelBiulder?
Ans. In ModelBuilder, you can iterate the entire model or just an individual process using Iterators.

Que. Explain spatial statistics toolbox.
Ans. The Spatial Statistics toolbox contains statistical tools for analyzing spatial distributions, patterns, processes, and relationships. 

Que. can we edit shapefile in arcmap.
Ans. yes by enabling editing option.

Que. Explain editing tool.
Ans. The Editing tools allow you to apply bulk editing to all (or selected) features in a feature class.

Que. What is attribute?
Ans. Non-spatial information about a geographic feature in a GIS, usually stored in a table and linked to the feature by a unique identifier.

Que. What is attribute query?
Ans. An attribute query is the process of searching and retrieving records of features in a database based on desired attribute values.

Que. Define two type for query in arcmap?
Ans. select by attribute and select by location.

Que. What is spatial query?
Ans. A spatial query is a special type of database query supported by geo databases and spatial databases.

Que. What are the type of attribute in GIS
Ans. Attribute data can be store as one of five different field types in a table or database: character, integer, floating, date, and BLOB.

Que. What is pyramid?
Ans. Pyramids are used to improve performance. They are a downsampled version of the original raster dataset and can contain many downsampled layers. Each successive layer of the pyramid is downsampled at a scale of 2:1. 

Que. What is raster compression?
Ans. The primary benefit of compressing your data is to reduce the size of the file to help save disk space. An added benefit is greatly improved performance over a network, because you are transferring a reduced amount of the data being read from disk and transferred to the server or direct read application. 

Que. What is coverage?
Ans. A coverage is a georelational data model that stores vector data—it contains both the spatial (location) and attribute (descriptive) data for geographic features. Coverages use a set of feature classes to represent geographic features.

Que. What is TIN?
Ans. Triangular irregular networks (TIN) have been used by the GIS community for many years and are a digital means to represent surface morphology. TINs are a form of vector-based digital geographic data and are constructed by triangulating a set of vertices (points).

Que. What is topology?
Ans. Topology is the arrangement for how point, line, and polygon features share geometry.

Que. What is terrain?
Ans. A terrain dataset is a multiresolution, TIN-based surface built from measurements stored as features in a geodatabase. They’re typically made from lidar, sonar, and photogrammetric sources. Terrains reside in the geodatabase, inside feature datasets with the features used to construct them.

Que. What is KML?
Ans. Keyhole Markup Language (KML) is an XML-based format for storing geographic data and associated content and is an official Open Geospatial Consortium (OGC) standard. KML is a common format for sharing geographic data with non-GIS users as it can be easily delivered on the Internet and viewed in a number of free applications, including Google Earth and ArcGIS Explorer. KML files have either a .kml or .kmz (for compressed or zipped KML files) file extension.

Que. What is netCDF?
Ans. NetCDF (network Common Data Form) is a file format for storing multidimensional scientific data (variables) such as temperature, humidity, pressure, wind speed, and direction. Each of these variables can be displayed through a dimension (such as time) in ArcGIS by making a layer or table view from the netCDF file.

Que. What is dimension?
Ans. Dimensions are a special kind of geodatabase annotation for showing specific lengths or distances on a map. A dimension may indicate the length of a side of a building or land parcel or the distance between two features such as a fire hydrant and the corner of a building.

Que. What is arcmap?
Ans. ArcMap represents geographic information as a collection of layers and other elements in a map. Common map elements include the data frame containing map layers for a given extent plus a scale bar, north arrow, title, descriptive text, a symbol legend, and so on.

Que. What is report in arcgis?
Ans. Reports present the facts and figures behind your analysis and are invaluable companions to the maps you are creating. 

Que. What is geoprocessing?
Ans. Geoprocessing provides a large suite of tools for performing GIS tasks that range from simple buffers and polygon overlays to complex regression analysis and image classification.

Que. What is arcpy?
Ans. ArcPy is a site package that builds on (and is a successor to) the successful arcgisscripting module. Its goal is to create the cornerstone for a useful and productive way to perform geographic data analysis, data conversion, data management, and map automation with Python.

Que. can we create tool in arcMap?
Ans. yes, using arcpy we can create tool.

Que. What is color balancing?
Ans. Color balancing attempts to remove trends across images to make them look more seamless. Statistics must exist for the rasters within a mosaic dataset When using color balancing.

Que. What is data view?
Ans. In ArcMap data view, the map is the data frame. The active data frame is presented as a geographic window in Which map layers are displayed and used. 

Que. What is layout view?
Ans. The Layout view is used to design and author a map for printing, exporting, or publishing. You can manage map elements within the page space (typically, in inches or centimeters), add new map elements, and preview What your map will look like before exporting or printing it. Common map elements include data frames with map layers, scale bars, north arrows, symbol legends, map titles, text, and other graphic elements.

Que. Explain page layout.
Ans. A page layout is the arrangement of map elements and their overall design on a printed page or a digital map display. It is one of the primary display views that you work with in ArcMap—primarily to create maps for printing or for export and sharing using PDF.
arcPy
arcGIS+python

Que. Explain geoid.
Ans. The geoid is defined as the surface of the earth’s gravity field, Which is approximately the same as mean sea level. It is perpendicular to the direction of gravity pull. Since the mass of the earth is not uniform at all points, and the direction of gravity changes, the shape of the geoid is irregular.

Que. Explain spheroid?
Ans. A spheroid is a three-dimensional shape created from a two-dimensional ellipse. The ellipse is an oval, with a major axis (the longer axis) and a minor axis (the shorter axis). If you rotate the ellipse, the shape of the rotated figure is the spheroid.

Que. Explain datum?
Ans. A datum is built on top of the selected spheroid and can incorporate local variations in elevation. With the spheroid, the rotation of the ellipse creates a totally smooth surface across the world. Because this doesn’t reflect reality very well, a local datum can incorporate local variations in elevation.

Que. Explain geometric datum?
Ans. An earth-centred, or geocentric, datum uses the earth’s centre of mass as the origin. The most recently developed and widely used datum is WGS 1984.

Que. Explain local datum?
Ans. A local datum aligns its spheroid to closely fit the earth’s surface in a particular area. A point on the surface of the spheroid is matched to a particular position on the surface of the earth. This point is known as the origin point of the datum. The coordinates of the origin point are fixed, and all other points are calculated from it.

Que. What is projected coordinated system?
Ans. A projected coordinate system is defined on a flat, two-dimensional surface. Unlike a geographic coordinate system, a projected coordinate system has constant lengths, angles, and areas across the two dimensions. A projected coordinate system is always based on a geographic coordinate system that is based on a sphere or spheroid.

Que. What are the projection types are?
Ans. conic, cylinderical and planar

Que. Explain false easting?
Ans. False easting is a linear value applied to the origin of the x-coordinates. False northing is a linear value applied to the origin of the y-coordinates

Que. Define scale factor?
Ans. scale factor is a unitless value applied to the center point or line of a map projection.

Que. Define vertical coordinate system?
Ans. A vertical coordinate system defines the origin for height or depth values. Like a horizontal coordinate system, most of the information in a vertical coordinate system is not needed unless you want to display or combine a dataset with other data that uses a different vertical coordinate system.

Que. What is z value in gis?
Ans. One z-value is shown for the height-based mean sea level system. Any point that falls below the mean sea level line but is referenced to it will have a negative z-value. 

Que. What is vertical datum?
Ans. A vertical coordinate system (VCS) can be referenced to two different types of surfaces: spheroidal (ellipsoidal) or gravity-related (geoidal). Most vertical coordinate systems are gravity-related.

Que. What is geographic coordinate system
Ans. A geographic coordinate system uses a three-dimensional spherical surface to define locations on the earth. It includes an angular unit of measure, a prime meridian, and a datum (based on a spheroid). In a geographic coordinate system, a point is referenced by its longitude and latitude values.

Que. What is line referencing?
Ans. Linear referencing is the method of storing geographic locations by using relative positions along a measured linear feature. 

Que. What is data segmentation?
Ans. Dynamic segmentation is the process of computing the map locations of events stored and managed in an event table using a linear referencing measurement system and displaying them on a map. The term dynamic segmentation is derived from the concept that line features need not be split (in other words, “segmented”) each time an attribute value changes; you can “dynamically” locate the segment.

Que. What is arcpro?
Ans. ArcGIS Pro is the new application for creating and working with spatial data on your desktop. It provides tools to visualize, analyze, compile, and share your data, in both 2D and 3D environments.

Que. Define animation in GIS?
Ans. An animation is a visualisation of the changes to the properties of one object (such as a layer) or a set of objects (such as multiple layers). Animations make your documents come alive by storing actions so they can be replayed as you choose. 

I hope this Question answer might have helped you in understanding ArcGIS and in clearing the Basics interview question of ArcGIS. Let us know if you have any other list of questions answer available in ArcGIS by commenting below in the space provided.

WPS Split polygon on Geoserver Openlayers

WPS (Web Process Service) is an OGC service that allows you to publish geospatial processes. This is available as an extension on geoserver. To add this extension you must check the version for geoserver you are using.
Before downloading the extension you can check whether WPS is available in you local geoserver or not. For that go to demos section check for WPS request builder.

WPS Split polygon on Geoserver

WPS Split polygon on Geoserver

If not available please follow. To add this extension just download the extension and extract the file in WEB-INF/lib folder of your geoserver.
After extracting this, you can check WPS (Web Process service) with version in service capability section on right side of login page of geoserver.

WPS Split polygon on Geoserver

There are many processes available in WPS request builder. In this article will see the splitting of existing or newly created polygon using geo:splitPolygon process.

There are two options available to split a polygon in GeoServer.

1. Using WPS request builder option on geoserver, by providing the geometry for polygon and line string.
2. Creating a map with options to draw and split polygon interactively.

Execute Process on Geoserver with split polygon

For the first option you need to navigate to WPS Request builder option and choose the geo:spliPolygon process.

WPS Split polygon on Geoserver

Then provide the geometry of polygon to be split and geometry of line string, which will split the polygon.

WPS Split polygon on Geoserver

Then write values,

WPS Split polygon on Geoserver

The output can be collected as geometry WKT(well know text), Json (Javascript object notation) format or GML(Geography Markup Language). You can also check the generated XML with provided inputs.

WPS Split polygon on Geoserver

The execute button is available for executing the process. this will prompt you to download the geometry of spited polygon. In the result you can see the geometry collection will contain number of polygons.

WPS Split polygon on Geoserver

Execute Process by creating Map – WPS Split polygon on Geoserver

For visualization of splitting of polygon you can create a map with option to draw the polygon and spilt option. This article is created using OpenLayer JavaScript library with three radio buttons for draw polygon, splitting line and drag.

Use WPS on Geoserver To create map using OpenLayer library you need to add the openlayer script and to use splitPolygon process you need to split-poly javascript file in your document. In the given lines echo base_url() fucntion gives the project name on localhost. Instead of this you can give the folder path, where these files are kept

The requires a library of file which can be downloaded from https://github.com/openlayers/openlayers/tree/052be822882ef527dedb82d7d3cc19adc76d6371 link. The lib folder is required. As this contains various javascript file which are required while running this example. Now to add all these files in your document in tag, you can follow the given code.

Here we have taken all the file name in jsFiles variable.

if(!singleFile) {
  if (!jsFiles) {
  jsFiles = [
  "OpenLayers/BaseTypes/Class.js",
  "OpenLayers/Util.js",
  "OpenLayers/Animation.js",
  "OpenLayers/Lang/en.js",
  "OpenLayers/Spherical.js"
  ]; // etc. write all file name
  }

After table created a script tag and using for loop inserted file names in src of script tag

 var scriptTags = new Array(jsFiles.length);
  var host = OpenLayers._getScriptLocation() + "lib/";
  for (var i=0, len=jsFiles.length; i";
  }
  if (scriptTags.length > 0) {
  document.write(scriptTags.join(""));
  }
  }
  })();

The host name is the base path which is collected from _getScriptLocation function.

function() {
  var singleFile = (typeof OpenLayers == "object" && OpenLayers.singleFile);
  // Relative path of this script.
  var scriptName = (!singleFile) ? "/var/www/html/PHP_pgrouting/lib/OpenLayers.js" : "OpenLayers.js";
  var jsFiles = window.OpenLayers;
  window.OpenLayers = {
  _getScriptLocation: (function() {
  var r = new RegExp("(^|(.*?\\/))(" + scriptName + ")(\\?|$)"),
  s = document.getElementsByTagName('script'),
  src, m, l = "";
  for(var i=0, len=s.length; i<len; i++) {
  src = s[i].getAttribute('src');
  if(src) {
  m = src.match(r);
  if(m) {
  l = m[1];
  break;
  }
  }
  }
  return (function() { return 'http://localhost/PHP_pgrouting/'; });
  })(),
  ImgPath : ''
  };

After adding all required Js files in document you can create a view or HTML page to visualize your map.
Just create a div for map and three radio buttons for draw, split and drag options.

Use WPS on Geoserver

Now Split-poly.js file contains the function all draw, split and drag option. one of them is given below

var dragPoly = new OpenLayers.Control.DragFeature(map.layers[1]);

var dragToggle = document.getElementById("drag");
  var toggleDrag = dragToggle.onclick = function() {
  if (dragToggle.checked) {
  drawPoly.deactivate();
  drawLine.deactivate();
  dragPoly.activate();
  } else {
  dragPoly.deactivate();
  }
  };

Similarly for all we can write functions. The split Function works as Take the drawn polygon and polyline features in variables. then check for intersection of polygon and polyline. If both intersects set hit variable a true. Check the intersections and execute split process.

function handleSplitDraw(event) {
  var splitter = event.feature;
  var features = map.layers[1].features;
  var candidates = OpenLayers.Array.filter(map.layers[1].features, function(feature) {
  var hit = false;
  if (feature.geometry.intersects(splitter.geometry)) {
  hit = true;
  }
  return hit;
  });
  var candidate;
  for (var i=0, ii=candidates.length; i<ii; ++i) {
  candidate = candidates[i];
  if (candidate.geometry.intersects(splitter.geometry)) {
  map.layers[1].removeFeatures([candidate]);
  executeSplit(candidate, splitter);
  }
  }
  return false;

The execute process will take the data in variable. This data will contain the input/output identifier and mimetype.

 function executeSplit(poly, line) {

 var doc = this.wpsFormat.write({
  identifier: "geo:splitPolygon",
  dataInputs: [{
  identifier: "polygon",
  data: {
  complexData: {
  mimeType: "application/wkt",
  value: wktFormat.write(poly)
  }
  }
  }, {
  identifier: "line",
  data: {
  complexData: {
  mimeType: "application/wkt",
  value: wktFormat.write(line)
  }
  }
  }],
  responseForm: {
  rawDataOutput: {
  mimeType: "application/wkt",
  identifier: "result"
  }
  }
  });

After this using post method of Openlayer we can send this data to geo:splitPolygon process and can collect the response. after collecting geometry as well known text we can render again this geometry on map.

OpenLayers.Request.POST({
  url: "http://localhost:8080/geoserver/ows?service=WPS&version=1.0.0&request=Execute&Identifier=geo:splitPolygon",
  data: doc,
  success: function(response) {
  handleSuccess(response, poly);
  console.log(response);
  }
  });

After writing code open the project on browser and draw a polygon using draw option.

WPS Split polygon on Geoserver

Now draw the splitting line using split option.

WPS Split polygon on Geoserver

As you finish the drawing part the executeSplit() function runs which splits the polygon which can be seen on map as

WPS Split polygon on Geoserver

Now to see, actually these polygons are splited or not. you can use drag option.

WPS Split polygon on Geoserver

In this way you can go for other processes available on geoserver. If you find any problem in implementing WPS Split polygon on Geoserver do comment below.

Install GeoServer for Ubuntu

Install GeoServer for Linux System. For producing any detail map, we need to have large detailed dataset. If it is about country level or world level analysis it may create huge problem with huge dataset. It can hang your system or slow down it. Even for browser it is dangerous because browser takes time or get in not responding mode. More than this you want to change or query data with rendering it on map, this will take much of your precise time.

To solve this problem we use some servers which can handle the dataset and provide us when required. For the map data we have one the great solution that is geoserver. What is geoserver and how it is helping us… geoserver is an open-source server written in Java that allows users to share, process and edit geospatial data. It helps us to display the information to the world. It has a great feature that using WMS (Web Map Services) standards it provides variety for output format.

Download and Install Geoserver in linux

To download and install Geoserver in Linux based system, please follow the content. First of all download the Geoserver zip folder. To download that navigate to http://geoserver.org/release/stable/ link and click the Platform Independent Binary link.

Now make sure that you have already installed Java Runtime Environment (JRE) in
your system. if not, please visit http://www.oracle.com/technetwork/java/javase/downloads/index.html website to download and install the JRE in your system. Currently Java 9 is not supported by geoserver so download JRE 8 from oracle.

Steps for installing GeoServer on Linux based operating system-

Step 1 for installing geoserver-

Extract the downloaded geoserver zip file. if you are not sure where to unzip it, navigate to usr/share folder and make a new folder name it as geoserver and unzip file in this folder.

STEP 2-

Open the terminal in your system and add an environment variable to save the location of GeoServer by running given command
–> echo “export GEOSERVER_HOME=/usr/share/geoserver”

Step 3 for installing geoserver in ubuntu-

To make sure you are the owner of the geoserver folder, run the give command
–> sudo chown -R USER_NAME /usr/share/geoserver/
Here replace USER_NAME with your user name. The user name can be your system’s user name, then it will ask for the password so give your system password.

Step 4-

After this navigate yourself to the bin folder inside the unzip geoserver folder and run the startup.sh file.To run this file on terminal, look given command
–> sh startup.sh

Step 5 for installing geoserver-

Now your geoserver is installed successfully to check open the browser and run the given command

–> http://localhost:8080/geoserver

Give admin as username and geoserver as password. Create your workspace and datastores for various datasets and upload them on geoserver with various styles and icons.

To know how to publish and style vector and raster dataset on geoserver you can visit our previous tutorials as Publish style vector data on geoserver, Publish style raster data on geoserver or install geoserver in windows operating system.

If you have other query related to geoserver or publishing and styling dataset on geoserver, let us know via comments. We would definitely help you out.

Convert Geojson to GML- Geography Markup Language

This article is about Convert GeoJSON to GML. Here we are using GDAL utility (ogr2ogr) for conversion. This conversion become useful when you just wants to study or analysis the data in text format. In GML format stores data as text in tags. It makes easy for user to understand the details of attributes. Before conversion, lets look for GeoJSON and GML (Geography Markup Language) in detail.

Convert Geojson to GML

Lets look for specification of GML and GeoJSON file before moving for conversion, as you should be aware of how the files are structured, so that if conversion has any minor error then it can be corrected. If you know specification of both the files, then you may skip and navigate to convert.

Online Tool to Convert GeoJSON To GML

Specification of GML – Convert Geojson to GML

GML stores geographic information as text developed by the OpenGIS Consortium (OGC). GML is based on XML and it is not programming language. it is just data describing language. It provides bounding box in the starting of file in ‘Boundedby’ tag. Feature member is defined with geometry property, SRS (Spatial reference system) used, coordinates and attributes.

Convert- Geojson to GML- Geography Markup Language

Specification of GeoJSON

Geojson data is open standard format, contains simple geographical feature with non-spatial data. In type, it has feature collection. That contains name, CRS (coordinate reference system) and features. These features can be line, point, polygon, Multi-Line string and multi-polygon. Properties contains all attribute information.

Convert- Geojson to GML- Geography Markup Language

Convert Geojson to GML using GDAL utility-

For converting GeoJSON to GML we need to have GDAL library in system. you can follow the commands to download the library.

Convert- Geojson to GML- Geography Markup Language

The presence of this utility  can be tested by typing ogr2ogr in command prompt. Convert- Geojson to GML- Geography Markup Language

Now, to check the drivers available you can follow the given command,

–> ogr2ogr –formats

Convert- Geojson to GML- Geography Markup Language

Convert GeoJSON to GML is an easy process, we also can assign the SRS (Spatial reference system) to the generated output file. ogr2ogr have various options, which can be used while converting file in other format.

–> ogr2ogr -f ‘GML’ -a_srs EPSG:4326 Output_fileName.gml Input_fileName.geojson

Here -f is an option for output file format. The ‘GML’ is driver available for converting file in GML.

Output of Convert Geojson to GML-

The Generated file can be open in any test editor.

Convert- Geojson to GML- Geography Markup Language

We can also help you out in conversion like Shapefile to geopackage, KML to GML , shapefile to TopoJSON and many more.

Feel free to comment in given box for any help or suggestions.

Convert Geojson to MIF MapInfo file

In this article we will be discussing about convert GeoJSON to MIF Mapinfo using GDAL utility (Ogr2ogr). This conversion is useful with MapInfo mapping and geographic analysis softwares.

Convert Geojson to MIF MapInfo file

We must understand GeoJSON and MIF format in detail before conversion.

Convert Online GeoJSON to MIF Mapinfo

Specification of GeoJSON data- Convert Geojson to MIF

Geojson data is open standard format, contains simple geographical feature with non-spatial data. In type, it has feature collection. That contains name, CRS (coordinate reference system) and features. These features can be line, point, polygon, Multi-Line string and multi-polygon. Properties contains all attribute information.

Convert Geojson to MapInfo file

Specification of MIF data- Convert Geojson to MIF

Convert Geojson to MapInfo file

MIF (Map Info File) File format used by MapInfo mapping and geographic analysis software. This stores a map visualization in a format that can be recognized by third party applications. Also used as an exchange format between GIS applications. This sometimes accompanied by a .MID (MapInfo data) file that contains additional spatial data. MID files are GIS data files created by MapInfo, a spatial data analysis and visualization software, saves spatial data for a corresponding .mif (MapInfo Interchange Format) file. Also used for storing larger data sets not expressed in the MIF file.

MIF file show some general property when open with QGIS software, as like :

i.) Storage type of this layer
–> MapInfo File
ii.) Description of this provider
–> OGR data provider (compiled against GDAL/OGR library version 2.2.2, running against GDAL/OGR library version 2.2.2)
iii.) Source for this layer
–> /var/www/html/PHP_pgrouting/public/shpfolder222/newwhello.mif
iv.) Geometry type of the features in this layer
–> Line
v.) The number of features in this layer
–> 19148
vi.) Capabilities of this layer
–> Fast Access to Features at ID, Presimplify Geometries, Presimplify Geometries with Validity Check
vii.) In layer spatial reference system units
–> xMin,yMin 68.4982,7.92528 : xMax,yMax 97.3348,35.5013
viii.) Layer Spatial Reference System
–> +proj=longlat +datum=WGS84 +no_defs

Convert Geojson to MIF MapInfo file

  • Go to MapOG Tool
  • Tap on Switch To and click on Converter.
  • Now upload your data from system or drag & drop from system.
  • Once input is uploaded select the output format and if you want to change coordinate reference system then click on the third option. And in the last click on Convert File.
  • You converted file is published on the map directly.
  • Check video for steps of conversion for Geojson to MIF.

Convert GeoJSON to MIF using GDAL utility-

Gdal library should be available in system when converting data format from one to another. This utility can be installed in system by following the given commands.

Convert Geojson to MIF MapInfo file
Convert Geojson to MIF

The options available with ogr2ogr utility cab seen by typing ogr2ogr in command prompt.

Convert Geojson to MIF MapInfo file

The drivers or format supported by utility can be seen by typing the following command.

–> ogr2ogr –formats

Convert Geojson to MIF MapInfo file

Convert the Geojson data in MIF with given command.

–> ogr2ogr -f  ‘MapInfo File’ -a_srs EPSG:4326 MIF_output.mif geojson_input.geojson

The option -a_srs is used to assign coordinate system to generated output file.

Output in QGIS software- Convert Geojson to MIF

The generated output file can be open with QGIS open source software.

Convert Geojson to MapInfo file

You can also use conversions using gdal utility as netcdf to geotiff, Hdf to geotiff, shapefile to topojson and many more.

Please comment in the given comment box for any help and suggestions. We are always ready for your help.

You might be interested in Different ways to convert Shapefile to GeoJSON

Convert GeoJSON to KML

In this article we would be discussing about conversion of GeoJSON data to KML (Keyhole Markup Language). This conversion is required when you are using software such Google earth to see the data. KML works great with Google earth. There is simple step to Convert GeoJSON to KML using ogr2ogr utility from GDAL library. Before that we must go through specification of GeoJSON and KML.

Here is the way to Convert the GeoJSON to KML online

Specification of GeoJSON – Convert GeoJSON to KML

Geojson data is open standard format, contains simple geographical feature with non-spatial data. In type element it has feature collection. That contains name, CRS (coordinate reference system) and features. These features can be line, point, polygon, Multi-Line string and multi-polygon.

Convert GeoJSON to KML
Convert GeoJSON to KML

Specification of KML- Convert GeoJSON to KML

The KML (Keyhole Markup language) this data format contains information in tags. SimpleField contains attribute information with name and type. Style tag contains the style of file as color of lines, points and polygons. Geometry is stored as coordinates in file.

Convert GeoJSON to KML

Convert GeoJSON to KML using GDAL Utility-

The conversion requires Gdal utility. This utility can be installed in the system by following the given commands.

Convert GeoJSON to KML

By typing ogr2ogr in command prompt you can get the following result. This result shows the presence of ogr2ogr utility in system.

To know the version of installed GDAL library you can type,

–> gdalinfo –version

Convert GeoJSON to KML

Before executing the conversion command, you should check the drivers. The drivers can be checked by typing

–> ogr2ogr –formats

in your command prompt. Now check for the GeoJSON and KML driver.

Convert GeoJSON to KML

After checking the drivers you can execute the following command.

–> ogr2ogr -f ‘KML’ -a_srs EPSG:4326 Output_fileName.kml Input_FileName.geojson

Output of Convert GeoJSON to KML-

The generated output file can be open in editor to see the content.

Convert GeoJSON to KML

In the similar way you can also convert shape file to MIF, shapefile to sql and shape file to excel file.

You can also comment in given comment box for any query, help or suggestions.

NetCDF Multidimensional data

NetCDF (network Common Data Form) is multidimensional data format only supports EPSG 4326 (WGS84). Multi dimensional simply means that it can grow in all direction with time. It has some important vocabulary to defines formation of NetCDF data structure. You may also look over HDF multidimensional Data, GRIB multidimensional data and all multidimensional data. To know about NetCDF you must go through this:

  1. Dimension
  2. Variables
  3. Coordinate Variables
  4. Attributes
  5. Conventions

MultiDimensional Data

Dimensions of NetCDF Multidimensional data:

NetCDF has dimensions from which only one dimension can be Unlimited that can grow up-to any length in any direction.  These dimensions can be physical quantities as latitude, longitude, altitude and time.

Variables:

Variable are array of values of same data type in NetCDF file. A variable has a name, data type, and shape described by its list of dimensions.

Coordinate Variables:

A one-dimensional variable with same name as a dimension is called coordinate variable. We can take an example from figure above float time(time). It is associated with a dimension and one or more data variables. Typically defines a physical coordinate corresponding to that dimension.

Attributes:

NetCDF attributes stores metadata of geographic data. Most attributes provide information about a specific variable. These attributes can be identified with structure variable name:attribute name.

Attribute as Long_name shows full name of given band and Unit shows is measurement unit.

Conventions:

The conventions define metadata that provide a description of the data in each variable and their spatial and temporal properties. A convention helps users of data from different sources decide which quantities are comparable. The convention name is available in global attribute in a netCDF file as shown below.

NetCDF Multidimensional data

Details of NetCDF Multidimensional data:

To see all these you can use GDALinfo or ncdump command.

To use gdalinfo command for having netcdf information, you need to write

–> gdalinfo -json filename.nc

NetCDF Multidimensional data

To use ncdump command for viewing information about NetCDF data, you need to write

–> ncdump filename.nc | more

NetCDF Multidimensional data

If you face any problem in understanding NetCDF multidimensional data, please let us know via comments.