Angular: Using BehaviorSubject to react to a user action

Recently I had a case where I needed some Angular components to listen to a user action and update their model based on that action.

That action was switching languages for specific components. There are many ways to actually achieve such a behavior, but I decided that the most elegant way was to use BehaviorSubject.

(more…)

Generic Clients for GeoServer

Third post this year. Charming :-)

I’ll start with a little gossip.

One member of our team (and probably the most important) left the current company that we were collaborating with and the rest of us are more or less still debating whether we should follow his lead or not. Time will sort things out I guess.

In the mean time, I decided to write a small gis app, that functions as a generic interface for Published Geoserver Layers (or any other ogc compatible GIS server).

The need arose after writing several demo apps for various projects…and since as they say “a good programmer is a lazy programmer”. Which in my case translates to

“I hate to repeat, over and over and over my work with minor configuration changes”.

I decided to write something like this and share it with the world.

(more…)

ArcMap Custom Tools

Posts in this blog are a rare thing. The main problem is that we don’t really have a lot of time, plus we can’t share most things that are being developed in the company that we are currently collaborating with. (not to mention that I am soon to become a dad and thus time will be even more limited)

Nevertheless lately we had among other things to develop some custom tools and add-ins for esri’s ArcMap platform. Although we are usually against developing plugins for non expert users on such complex platforms (we prefer developing a standalone engine based application) due to a lot of restrictions and security mechanisms we were in a sense forced to accept such solution.

Among this solution we developed some simplified editing tools for less expert users. A generalized version of those tools are now available at git-hub.

Enjoy

geonetwork queries

Recently we had a project that a part of it was about querying a local Geonetwork server from a custom interface and being able to project both the returned XML schema as well as the results’ bounding box into a OpenLayers map.

For several reasons, I didn’t want to use a server side language so I just went ahead and did everything in Javascript.

I know that such thing is nothing special. It’s just figuring out how to form the XML request the way Geonetwork requires it.

So after writing the whole thing up. I thought, why not publishing the JavaScript code at a  github project. You never know someone might need such solution in the future.

It obviously doesn’t work out of the box, since it was written in a hurry and based on a particular interface, but its pretty obvious how it works, to anyone who writes JavaScript.

I intend to write detailed comments as to what does what and whats the purpose of all those variables, as well as to make it a bit more generic.

 

 

Esri Dev Summit Europe 2013

This year we attended for yet another time the Esri Dev Summit in London.

This year was way better than last year, from every aspect. ESRI was way more organised, had better quality in presentations (though there were a few exceptions) plus a lot of amazing innovations. Also the food was more “interesting”.

They claim that they improved the whole conference based on last year’s feedback, and I definitely believe them. So thumbs up on that, even if the conference began with a fire drill, driving everyone outside in the cold (same thing happened last year…in a couple of years it might end up as a conference ritual).
(more…)

camera simulation

Its not often that someones asks you to re-invent the wheel. But this was one one these times and it was mostly necessary.

The task involved projecting already digitized city blocks outlines onto camera images.

A normal approach would be something among the lines of drawing the shapes in a 3d space (directX, openGL etc) and showing the image in the background. But when you want to accurately simulate a “real” existing camera then it seemed to me easier to build the whole construct from scratch.

In Order to do that we had to know both the interior and exterior orientation of the camera.

  • the interior orientation is the position of the principal point, the focal length and the radial distortion. Some manufacturers provide those values (when it comes to photogrammetric cameras at least) but most do not. There are ways to calibrate yourself a camera but that’s completely a different topic.
  • the exterior orientation of the camera is the position (x,y,z) and rotations (ω,φ,κ) of the camera at the time of the shooting

So what we need to do is to go from city block coordinates to image coordinates.
The main idea is described in the following steps
(more…)

Cad implementation using the Javascript based topology library

Today I had some time and I decided to resurrect and update one sample page on how to use the topology Javascript library (codenamed tougo) I developed a couple of years ago.

The sample demonstrates some basic functions of a simple drawing app. You have the option to draw circles, boxes, triangles and lines. Originally I called it a Cad app cause you had the option edit the drawing and to export it to a dxf file.

The export option in this sample is deactivated (although the sample does includes the Javascript code to do so).

I may add a couple more features in due time.

enjoy the sample page and feel free to pop a question. Btw it only works on webkit browsers due to mozilla html5 canvas incompatibilities

UPDATE:  I updated my code to the latest version where I have solved the mozilla html5 canvas incompatibilities, so now it works,  just fine, on both browsers.

(more…)

JavaScript based geometric and topological operations

A while ago I was working on a personal project concerning various geometric and topological operations on html5 canvas elements. Nowadays it is a bit abandoned but It was a pity to let it go to waste. So I made a public repository on Bitbucket and GitHub.

https://bitbucket.org/stefelpho19/tougo
https://github.com/elasticrash/tougo

As of today 19-November-2013 I would be maintaining the github version

Oracle Universal Installer

Today we had a, what it seems, minor task of installing a Oracle Database instance on a remote server. But for some unknown reason we kept getting the following console output and then …nothing.

So we set onto the unknown searching throughout oracle website, forums, blogs, google …and got almost nothing.  Just a big load of crap concerning rare cases about remote installation failures etc.

After a lot of searching we found in the oracle database forums a post by a single person that said that for some reason Oracle Universal Installer fails to Launch while your installation drive has ~ 3TB empty space. Ours had ~2.6TB but still the launcher failed, so with a big more digging we found out that Oracle for some reason (probably cause 3TB didnt exist on the oracle database latest release)  didnt support >2TB drives.

Bottom Line we had to trick the system by creating an empty 1TB file using fsutil

And it worked!

Obviously ;-)

City Engine Presentation

Last week we attended a small presentation concerning a procedural modeling software called city engine. The reason of this event is the merging of the existing city engine software with esri’s next release of ArcMap 10.2

This presentation took place in Athens. The main speaker was Mr. Gert Van Maren.

Procedural Inc. was acquired by Esri in the summer of 2011. As I understood by the presentation, City Engine wont stop its standalone release due to a lot of clients not be interested in GIS oriented applications but rather focused on more media oriented tasks.

The speech was really interesting and I enjoyed it a lot (I didn’t fall asleep, like I usually do in such occasions when the presentations are dull and boring). Although to really absorb the info presented by Mr Gert Van Maren you had to at least try the software prior, in some extend. Because otherwise everything sounded easy and magical. He didn’t focus that much on the difficulty of rule writing, especially when modeling existing cities. He did though present a graph that stated that initially even conventional handmade models could be faster than procedural modelling. But once the rules were well defined and established the times for future projects could be scaled down to a tenth.

The only annoying thing about the whole presentation was the speech of the Greek esri representative, that besides the endless irrelevant topics he touched, he appeared to have an attitude of selling tomatoes instead of a 3D procedural GIS modeling software.

press more to see a live example of they web-GL implementation
(more…)