Sunday, May 11, 2014

How to Publish Shape file on ArcGIS server

How to Publish Shape file on ArcGIS server


This tutorial will guide you in publishing shape file on ArcGIS server. This is a basic introduction to ArcGIS server, i am going to publish a single shape file on ArcGIS server.

Well upto this point i assume that you have ArcGIS server installed and ready to use.
(For connecting ArcGIS server to ArcCatalog click here)

Talking about professional approach you need to open shape file from data base but for this tutorial a single basic shape fill will be enough.

Now, Open ArcGIS for Desktop (ArcMap) and Add shape file 



Go to file, Share As, and click Service

Click Publish a service



Click next, and Choose a connection 
" arcgis for local host_6080 (admin) "
and then rename the service

Choose "use existing folder" (if you want to publish on the same folder i.e. root)

Now, Service Editor will be opened, here you'll set the properties of service to be published. (e.g. Type of service, No of Instances, Description, Tags, etc. )

Click on Analyze, It'll show the warnings (ignore these warnings as this is for the basic purpose whereas for publishing for a project a professional purpose Remember Each and every warning is important) and now click publish.



Now click Publish.
Now open http://localhost:6080/arcgis/rest/services and You'll se your shape file there.

Shape file is published . Now for adding it to any API (Google Map Api use its address)
http://localhost:6080/arcgis/rest/services/Test_Service/MapServer





Tuesday, May 6, 2014

Esri ArcGIS Server, Publish Shape File Warning 30003: Layer draws at all scale ranges

Esri ArcGIS Server, Publish Shape File Warning 30003: Layer draws at all scale ranges


When Publishing shape files from ArcGIS server i received a warning "30003: Layer draws at all scale ranges". 
This post concerns about what this warning is and how to resolve this issue.

What is warning 30003 : Layers draws at all scale ranges, well working with maps you have probably come up with a problem that information at certain zoom level jumbles up and you have to zoom in and zoom in to perceive information


When you set information detail in dependence with zoom level you can have this warning removed.

Note: For Beginners, never ignore a warning while publishing ArcGIS server layers, its a tip :) 
You try to google the errors and you'll know what things are and how they work . . . 

If you publish a shape file whose extent is specified you MUST MUST MUST read this article.

How to Use Apache and PHP installed from Stack Builder (PostgreSQL)

How to Use Apache and PHP installed from Stack Builder (PostgreSQL)


Well, When i started working with PostgreSQL (POSTGIS) specially Apache and PHP, i faced a problem of deploying my application on local server. Normally when we work on Apache and PHP we normally use different pre-configured configurations like (WAMP, WAPP, XAMP etc) or we configure it manually, in doing both we deploy application in the "Apache" folder and inside apache folder we deploy it or copy (application) website into "htdocs" folder and then we open it using web browser by typing localhost/test.html (if we deploy (copy) test.html).
Whereas in case if you installed Apache and PHP using stack builder we have to deploy application in "www" folder. i.e. copy the website into www folder. 
Also if you want to check the version of Apache and PHP open browser and type http://localhost:8080/
It'll open the default page and you can see the PHP and Apache version Also it'll make sure that server is up and running.
Also you can check it by going to start menu and click EnterpriseDB Apache PHP. It'll open the localhost default page.


Wednesday, April 2, 2014

PostgreSQL Libraries for ARCGIS Server (Register Database with ArcGIS server)

PostgreSQL Libraries for ARCGIS Server (Register Database with ArcGIS server)


What correct Libraries to use ??
Well there are four type of client libraries
  1. pg_client_windows64
  2. pg_client_windows86
  3. pg_client_linux64
  4. pg_client_linux86
  1. pg_client_windows64
    This include client files required to make connection from 64 bit windows platform client to PostgreSQL
    libeay32.dll, libintl.dll, libpq.dll, and ssleay32.dl
  2. pg_client_windows86
    This include client files required to make connection from 32 bit windows platform client to PostgreSQL
     libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, and ssleay32.dll
  3. pg_client_linux64
    This include client files required to make connection from 64 bit linux platform client to PostgreSQL
     libpq.so, libpq.so.5, and libpq.so.5.3.
  4. pg_client_linux32
    This include client files required to make connection from 32 bit linux platform client to PostgreSQL

Required libraries need to be copied to 
C:\Program Files\ArcGIS\Server\bin  

Register Database to ArcGIS server

Register Database to ArcGIS server


While publishing data (from database) to ArcGIS server it gives you a warning that

24011: Data source is not registered with the server and data will be copied to the server

How to resolve this ??
Well there are different approaches, here is the one which i followed. But before doing anything Please Note:
Note: The client side libraries need to be copied to ArcGIS server's bin folder. What does this mean ??
Well you have to copy the libraries (obtained from esri's customer portal Or simply google it "PostgreSQLClientLibs922" Or PostgreSQL libraries for ArcGIS server)
Copy the correct version of libraries to
C:\Program Files\ArcGIS\Server\bin   

Note to see the correct version of libraries click here.

Now,
  • Open ArcGIS server Manager from (prefer Internet Explorer)http://localhost:6080/arcgis/manager/site.html
  • Sign in to your ArcGIS server account
  • On home Page under Directories tab click on Data Store
  • Click on Registered Database


  • Type Name, and click on Import. It'll ask you "The System/PublishingTools service is currently stopped. Click Start Service to start it now and continue with registering a Data Store". Click on start service
  • It'll then ask you "Select the connection file (.sde or .odc file) you want to import."
  • Browse to Select the connection.sde file. 
  • Where you can find .sde file ??
  • Open Arc Catalog and then right click your database connection file and click on properties under DATA BASE CONNECTIONS in Arc Catalog tree.
  • There you will find the path of your connection file.

  • Now using this path browse to select the connection .sde file for both the Publisher Database connection and server database connection (Mostly its the same)

Upon successful import you'll see this 

Click on Validate All and the question mark will be removed.















Saturday, March 29, 2014

Error while starting AppServer. Required port '4000' already in use

Error while starting AppServer. Required port '4000' already in use

I faced this error while registering database to ArcGIS server, well this can be resolved by opening 
  1. Control Panel 
  2. System and Security
  3. Administrative Tools
  4. Services
On Services window find the ArcGIS server service and stop it. 
and after few seconds start it or restart it for automatic restart. Then again try and you'll see that error is removed.

Reason for this.

ArcGIS server uses javaw.exe and it got Hang, This was keeping port 4000 busy independently from ArcGIS server. So it said that Error while starting AppServer. Required port '4000' already in use.

Connect Postgresql to ArcGIS

Connect Postgresql to ArcGIS


If you are having problems connecting Postgresql to ArcGIS This post will describe in detail how to connect, Moreover i will post some more things on Postgressql, PostGIS, Arc Catalog, ArcMAP, Arc GIS Server etc

First Install Postgresql and also its spatial Extension (PostGIS). When this is installed we have to instal Postgres client side libraries for the successful connection.

(Note: Be sure to download the correct libraries for your ArcGIS client. For ArcGIS for Desktop and ArcGIS Engine, you need the 32-bit libraries. For ArcGIS for Server, you need the 64-bit client libraries)
Client Side Libraries:
Copy
libeay32.dll
libiconv-2.dll
libintl-8.dll
libpq.dll
ssleay32.dll
from the PostgreSQL folder and put it into the ArcGIS Desktop bin folder




Now Open Arc Catalog,
and click on Database Connections in Catalog Tree and then open Add Data Base Connection



It will open connections window, add the following information
  • Select PostgreSQL from Database Platform
  • Write 127.0.0.1 in Instance window
  • Select the Authentication type, use Database Authentication and write the user name and password in the database,
    Note : The default super user of PostgreSQL may vary as it come with different combinations of softwares i.e
    • If you have downloaded it directly and then installed Apache and phpmyadmin from StackBuilder then username password is
      username : postgres
      password : postgres
    • Where as if you download it from bitnami i.e. WAPP server (Windows + Apache + PostgreSQL + Php) then username password would be
      username : bitnami
      password : bitnami
    •  Or you can always make a super user/ user of your own choice from database or Phpmyadmin.
  • When you enter instance and user name password then on successful connection you should be able to see the list of databases in the Database dropdown menu, here i only have the sample postgis_21_sample database, press ok and You'll have the connection.