Monday, 17 June 2019

Create UNIX timestamp for ArcGIS Server Feature REST API

When you feed or update datetime column in ArcGIS REST API the current date and time has to be in UNIX epoch milliseconds.

In Python this is the easiest way to do:

int(time.time())*1000
The *1000 is required to get the milliseconds from the seconds. Obviously this way is only accurate to the second...if you want to gain more precision you should perhasp go with this:
float(time.time())*1000
With this methodology you will not loose the milliseconds due to integer rounding.

Friday, 14 June 2019

Cannot convert a value of type \'java.lang.String\' to \'TIMESTAMP\'

The ArcGIS REST API just needs an epoch time bigint - so convert it to numbers.

To check the values this site works:
https://currentmillis.com/



How to prepare JSON payload for ArcGIS Feature Service using Python

There you have it - this is just a dump from my code - purely to remind myself...

What it does it creates a point array then using Python it puts this payload to an ArcGIS Feature Service.


ptemp = {}
... print type(ptemp)
... ptemp["attributes"]={}
... ptemp["attributes"]["objectid"]=1
... ptemp["attributes"]["s"]=223
... ptemp["attributes"]["a"]="a val"
... ptemp["attributes"]["n"]="n val"
... ptemp["attributes"]["b"]=123
... ptemp["attributes"]["p"]="p val"
... ptemp["attributes"]["g1"]=11
... ptemp["attributes"]["g2"]=22
... ptemp["attributes"]["g3"]=33
... ptemp["attributes"]["g4"]=44
... ptemp["attributes"]["g5"]=55
... ptemp["geometry"]={}
... ptemp["geometry"]["x"]=152.95359856272353
... ptemp["geometry"]["y"]=-23.461733290059232
... ptemp["geometry"]["spatialReference"]={"wkid" : 4326}

So we created the ptemp dictionary object with point parameters.

>>> url = config["serviceurl"]+"/0/addFeatures?token={}&f=pjson"
... token = getToken("uname", "password")
... url = url.format(token)

Now we acquired the token and added to url.

>>> pptemp = []
>>> pptemp.append(ptemp)

Now we just put the dictionary to a list - this needed for the ArcGIS Feature Service.

pt = urllib.quote_plus(json.dumps(pptemp))

Now we created an encoded payload from json string.
st='features='+pt
st=st+'&gdbVersion=&rollbackOnFailure=true&f=pjson'
...and finally we send all of these to the ArcGIS Feature Service in a POST request:

>>> request.add_header("Content-Type",'application/x-www-form-urlencoded')
>>> request = urllib2.Request(url, data=st)
>>> connection = opener.open(request)
>>> connection.readlines()

Monday, 3 June 2019

Goliath Search Engine Resources

Here we list all resources we have found in relation with Goliath Search Engine. Entries and indexes were found all around the web. These indexes are listed below:

Search Engine with a Difference - Goliath Search

I have been stumbled across with a new Search Engine called Goliath Search. It seems a standard web search engine at first but using it a few times made me realize that search results are really different than using Google and Bing - I would say the provided search results are more aligned with the search term and really didn't brought up any spam-like websites either.

What I really liked that this search engine also provides you with a PDF search facility. This means that all of returned search results are actually PDF documents rather web pages. This is a very unique feature, which no other search engine provides - unless the user puts special codes in to the search term.

All in all - Goliath Search is a rather unique search engine and I shall recommend all my readers to give it a try...its free :)

Read more about this search engine...access some additional features of this search engine here...

Monday, 11 March 2019

Manuscript Map of Cairo - art and navigation in one page

Throughout my lunchtime browsing I found this really nice looking map of Cairo. The original is from the Book of Navigation or something. If you like nice, colourful maps then you will like this a lot no doubt...


I particularly like those small palm-trees around the river and oasis...they really give a unique touch to the map as it is.

How to make ArcGIS Diagrammer to work on systems with ArcMap 10.3+

ArcGIS Diagrammer is a pretty good - if not the only - visual database design tool that can help you create complex geodatabase models.

ArcGIS Diagrammer in Action
ArcGIS Diagrammer in Action

Unfortunately if your ArcMap installation is higher than 10.2 then you will see an error when you try to run ArcGIS Diagrammer after installation. Regrettably ESRI doesn't want to officially support Diagrammer anymore.

The solution however is very simple. There are a bunch of dll files that you need to copy to the BIN folder under your Diagrammer installation folder (in windows its normally C:\Program Files (x86)\ArcGIS Diagrammer).

After you copied these dll's into the BIN folder just start Diagrammer as you would normally do and voila...it will work.

Just click to the ArcGIS Diagrammer DLL text to download the zip file.

Enjoy