Wednesday 9 September 2015

Anchor tag Click Event on Page Load

Here is a snippet code sample for click event on DOM Load. There are times when, map <div>'s content text visibility is coded to synchronize with a user's click event. JavaScript code does execution of the code so beautifully, that so often a page loads with a DOM's  <div> space empty waiting for user events.

Not so, with Jquery's trigger event framework. Try your hands on the following code to have a program to automatically trigger a click event on your first anchor tag. The page loads in with your intended anchor tag by default and of course avoid having to present empty <div> space.

<script>
    $(document).ready(function(){
        $('The ID/Class name of the intended a href tag').trigger('click');
    });
</script>



Friday 3 July 2015

GIS Web Services

First, lets define the generic term Web services. Applications or components that can be published, found and used on the World Wide Web are called Web services.  Webservices are XML based (Now, to understand that, you don't need to study XML, I promise!) and the pudding of using web services is that it is highly inter-operable and is designed to  handle specific or limited set of tasks.

So, from the above snippet, the obvious things are

a) Web services communicates between applications
b) Information can be published or distributed to a large audience or users
c) Web Services can be reused for existing services
d) Great in handling specific task


Now, with the above four things let me show you, how this model of web services can be replicated for GIS Mapping.

a) Web Services are building block of any mapping software. Take for example ArcMap which is nothing but clusters of ArcObjects tools and components, integrated to provide users with Geo-spatial analysis capabilities. One step further, Sharing map services between application of ArcMap to ArcServer (and Web Adaptors between, indeed), that's another classic case of demostrating Web Services framework

b)  The ArcServer, ArcOnline, Portal for ArcGis all come with capabilities to publish mapping services to large user base, either on web or within organizations or between organisations.

c) The map services so published, can be constantly overwritten over existing services, so for the spatial data sets to be up to date or current.

d) Specific Task. This is my favorite and i would prefer to elaborate it the ESRI way!!! The user/client capabilities on the mapping interface, like

  •  downloading maps for a specific location (Map Services)
  • enabling the client to use all the ArcMap tool capabilities (Geo-processing Services) 
  • data or feature updates (In DB terms "INSERT"), performed by the client (Feature Services)
  • enabling the user to convert descriptive address or location names into lat/lon coordinates (Geocoding services)
  • enabling the user to perform analysis of published route networks (Network Analysis)
  • enabling clients to generate 3D maps (3D Scene Services)

  • enabling user to measure, create buffers and project (GeoEvent "Extension" but also follows the Services model.
A Note on Framework:

Now, we get to the basics of actual Web Mapping. 

Any application is hosted on an Interface - what a user sees on the web page (Front-end), from the Server (Back-end) through data sets stored in Databases (Middleware). 

This framework applies for GIS, as well.

On an Open Source: The maps generated from QGis are stored in PostgreSQL and hosted through Geoserver service directory. These published maps can be either viewed on client viewers like uDig or further processed with OpenLayers and published on Web.

In ESRI: The maps generated from ArcMap, which of course of stored in Geo-databases, can be published directly are service through Arcserver.  The Service Directory of ArcServer lets you verify and test the web maps (and it's services), after which the map services can be further distributed to target clients.

The beauty lies in the details!... and i will elaborate on each of the segment and software in the upcoming posts....



Monday 29 June 2015

Web mapping with ESRI Cloud (AGOL)

GIS Analysts, who wish to try their hands on Web Mapping, yet have no programming knowledge or skill!!!! ESRI's cloud could be your best training ground. What i love about ArcGis Online is that it's simple, elegent and yet highly scalable and complex.  First, let me take you through the what you can leverage of this product:

Free access for limited content:

1. ArcMap map services need not take the tough route of being prepared as Service Definition Files , to be published on Web. All that is required, to publish limited content, is an Global ESRI Account and spatial Datasets (Either CSV or Zipped Shapefiles).
2. Configurable Pop-up's, symbology and  to some extent Legend.
3. Standard Templates, that help users with no HTML or CSS knowledge to pick and choose from the standard interfaces. These Templates are dynamic and are so filled with interactive controls , that it let's your users analyze for information, pattern and trends.
4. Responsive WebApplications of the map templates that can be shared over mail or embedded into your url.

Organizational Account:

Why invest in an expensive ESRI ArcServer when most of it's capabilities can be leveraged through ArcGis Online? Well ya,..... At an enterprise level ArcServer may be the best choice. But for Small to medium workgroups, who intent to publish  only map tiles and Feature services,  AGOL may be the best Choice. The organization has an option to publish maps on Web, Mobile and  Tabs. Geo processing controls are achieved through ESRI API for JavaScript and Like ArcServer, Veiwers of Flex and Silverlight can be used as well. An organizational Account is also powered with Analytics. 

How to get started with your ESRI AGOL Free Mapping:

1.  Log on to http://www.arcgis.com/home/ . Create a Global Account for yourself.

2.  Hover to "MAP" on Header section (Top section) on the Homepage.

3.  You should now see a base map layer, where you can  "Add Layer" to create overlays. Now, you have two choices. Either to use ESRI layers as map overlay and prepare you webmaps or to choose  your own map layer generated from ArcMap. A custom map service, should ideally be a "csv" format dataset with an spatial context or an zipped shapefile to upto 1000 attributes.

4. Once you are "Done adding Layers", "Save" the map and click on the "Share" icon, to access the ESRI WebMapping templates. Based on the context of you web map, ESRI has provided templates that you can choose from. 

5. Test the interface of your map, it's text and legend elements, both on Desktop web and Mobile. Play around with positioning, colors and text. Once you're all done, your first (Basic) web map is all set to be shared.

The first time, i tried my hands on capabilities of AGOL, i dd not know the creation of web maps can be made possible, relatively this simple. Though, the free mapping option of AGOL, provides limited access to create basic Spatial web services, it surely does open the users into the realm of web mapping. Try your hands on, as much as you can with AGOL!!! This is your sandbox to get a feel of what it takes of Mapping Interfaces and a platform that will gear you up into the real programming world of web mapping.,... I intent to keep the blog updated on the developer training of mapping web services. 
Until, then:

Happy Mapping :-)




ArcMap Geo-Coding

Aim:
 To Geo-code the address of Schools.

Procedure:

Step 1: Map Input
Address of Schools in Excel or Stand-alone Table Format (With Road Name, City, State), Reference Data (Census Data or OSM data for Non- US, possibility).

Step 2: Map Processing
1.       Enable the Geo-coding Extension with ArcGis
2.       Build an Address Locator using “Create Address Locator” Tool of Geocoding toolbox or by right-clicking on your geo-database (Feature Dataset).
3.       On the Address Locator Style Specify “Single Field” (This is mostly for Non-US, where the Address sequence does not follow a nationally uniform sequence. For US it is best to use “Dual Ranges”)
4.       Add on the Reference Data as the OSM Data set and set the Filed Map with appropriate Field Name and Alias Name. Make sure to set the primary key field to Street Name or House Number, through which the address matching will be processed.
5.       Now, to initiate Geo-coding of School Address Table, Click on the Geo-code address icon of the extension tool bar. Specify the attribute field name, which will link with the address locator’s primary key field.  One may also specify, Geo-coding Options of Spelling Sensitivity, Minimum Candidate Score,….
6.       Run Geocoding.  The results page with Matched/Unmatched and Tied Records.

Step 3: Map Display
7.        Generate Map Outputs of Geo-coding result, Matched Results (Select by attributes of Table and Export as shapefile) and Screen shot of results page.


Network Analyst: Closest Facility (with Barriers)

Aim:
 To create a Closest Facility Map with Road Blocks through the use of Network Analyst toolset

Procedure:

Step 1: Map Input
A Base map or toposheet on which Roads and Facilities Point features are digitized and exported as shapefiles. Also, identify, polygon barriers (Like construction locations where Roads are blocked)

Step 2: Map Processing
·         Geo-reference the base map with known location coordinates.
·         Import the digitized Line and Point shapefiles into the target Geo-database.
·         All Line entities of road feature class, needs to be split into right-angles at junctions. Hence use the Planarize line tool from Topology tool options under Editing mode.
·         In ArcCatalog, create a Network Dataset and add Road features.
·         Enable the Network Analyst option in Extension and choose the Closest Facility analysis.
·         In this section, identify and locate Polygon Barriers. This can be any Road Blocks along the route of the road feature class.
·         For Closest Facility analysis, the location of Facilities point and Incident Points are mandatory. One may choose to identify these Facility and Incident Locations manually or load point location shape file(s) created from the base map.
·         On properties of closest facility, set the Impedance to Break Values of Length in Meters.
·         Solve for Closest Facility. The Closest Facility Route Map (In custom Break Values) will be generated for Facilities Point Location.

Step 3: Map Display
 The final Output map can be displayed with Map Elements and grid properties of Layout.

Conclusion:

A Closest Facility route Map, with routes without road bloacks is generated through the use of Network Analyst extension of ArcMap.

Network Analyst: Closest Facility

Aim:
 To create a Closest Facility Map through the use of Network Analyst toolset

Procedure:

Step 1: Map Input
A Base map or toposheet on which Roads and Facilities Point features are digitized and exported as shapefiles.

Step 2: Map Processing
·         Geo-reference the base map with known location coordinates.
·         Import the digitized Line and Point shapefiles into the target Geo-database.
·         All Line entities of road feature class, needs to be split into right-angles at junctions. Hence use the Planarize line tool from Topology tool options under Editing mode.
·         In ArcCatalog, create a Network Dataset and add Road features.
·         Enable the Network Analyst option in Extension and choose the Closest Facility analysis.
·         For Closest Facility analysis, the location of Facilities point and Incident Points are mandatory. One may choose to identify these Facility and Incident Locations manually or load point location shape file(s) created from the base map.
·         On properties of closest facility, set the Impedance to Break Values of Length in Meters.
·         Solve for Closest Facility. The  Closest Facility Route Map (In custom Break Values) will be generated for Facilities Point Location.

Step 3: Map Display
 The final Output map can be displayed with Map Elements and grid properties of Layout.

Conclusion:

A Closest Facility route Map through the use of Network Analyst toolset is created.

Network Analyst: Service Area

Aim:
 To create a Service Map through the use of Network Analyst toolset

Procedure:

Step 1: Map Input
A Base map or toposheet on which Roads and Facilities Point features are digitized and exported as shapefiles.

Step 2: Map Processing
·         Geo-reference the base map with known location coordinates.
·         Import the digitized Line and Point shapefiles into the target Geo-database.
·         All Line entities of road feature class, needs to be split into right-angles at junctions. Hence use the Planarize line tool from Topology tool options under Editing mode.
·         In ArcCatalog, create a Network Dataset and add Road features.
·         Enable the Network Analyst option in Extension and choose the Service Area analysis.
·         For Service Area analysis, the location of Facilities point is mandatory. One may choose to identify these Facility Locations manually or load point location shape file created from the base map.
·         On properties of Service Area, Set the Impedance to Break Values of Length in Meters.
·         Solve for Service Area. The Service Area (In custom Break Values) will be generated for Facilities Point Location.

Step 3: Map Display
 The final Output map can be displayed with Map Elements and grid properties of Layout.

Conclusion:
A Service Area Map through the use of Network Analyst toolset is created.