Saturday, November 22, 2014

Building a Scanner and Parser for your programming language

As the CA component of Compiler Design module, I was given this project to implement a lexical analyzer and the parser(semantic analyzer) for C- (a language specification from the famous text book, Compiler Construction: Principles and Practice)

flex(lex) was used to implement the lexical analyzer while the parser was built using bison(yacc). Flex uses the header file generated by bison in order to identify tokens defined in the bison script.

Bison script defines different token types that are valid in our language specification.


Saturday, July 5, 2014

Saving and Indexing Shp resources in Arches

In this post, I am going to explain my work with internals of Arches data processing and how it models heritage data in the back-end. I described how the shapefile reader works in my previous post and in this, I will be explaining how shapefile records are collaborating with PostGIS and Elasticsearch.






Sunday, June 15, 2014

Shapefile reader for Arches

In my previous post I introduced how shapefile support can be provided for Arches in a very abstract and font-end perspective. By the time I write this post, I have started working on data processing methods. So this post will describe how things happen in the back-end. There are certain things that need to be glued together on order to complete the workflow and that will come in a later post.

Shapefile is a file format defined by ESRI in order to manage geographical data[1][2].
Currently Arches do not support shapefile format. With this improvement, Arches will be enabled to read user's legacy data from a shapefile and store them inside Arches as Arches resource instances.

Django GDAL(GeoSpacial Data Abstraction Library) interface was used in the development[3][4].
Current code is available in the data_import_mapping development branch at bitbucket repository trusira/arches[5]

Sunday, May 25, 2014

Shapefile support for Arches

Shapefiles (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf) are a widely used data exchange format among GIS data users. The new modifications will allow Arches users to load heritage resource data using Shapefiles.

A shapefile has the extension of .shp but a shapefile alone has no value. So every shapefile is associated with a couple more mandatory files (There are optional files in addition to these two mandatory files), an index file (*.shx) and a dBase table (*.dbf).

Friday, May 23, 2014

Connect to a Postgres database using pgAdmin III


pgAdmin III is a GUI tool to manage and query postgres databases. Assuming you have installed both postgres (in my case it is postgis) and pgAdmin we can proceed as follows.
pgAdmin III is available through Ubuntu software center. 


add new server

Sunday, April 13, 2014

Build an executable jar from a maven project

Not all the jar files are executable because there should be a well defined access point (public static void main(String[] args)) for a jar package to be executable.

Add the following plugin under plugins in your pom file. Eg: If I have my main method in class named, MainClass.java, I add the following.

<plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.4</version>
          <configuration>
            <archive>
                <manifest>
                    <mainClass>MainClass</mainClass>
                </manifest>
            </archive>
          </configuration>
 </plugin>
Fork me on GitHub