Thursday 11 February 2021

Using SQL Developer to visualise Geometry data

I was looking to see if shapes were incorporated inside other shapes.

I could have let the database check this, but sometimes it is very insightful to have a visual representation.

It turns out, SQL Developer facilitates this.

If you select a geometry field in your table, and right click and select [Display geometry shape], you'll get a nice little window indicating the shape.

Sometimes this is greyed out. The solution for this is to click on [Edit] in the menu above, and select [Map View]. This will "initialize" stuff, and then it's no longer greyed out.

Map View

The map view is very convenient, if you wish to show multiple shapes and how they interact.

To get started, select under "View", "Map view" and you are presented with a new subwindow.

Pressting the "New" button in the Map View window, you can just enter a query that returns a geometry, give it a name, proper colouring, and you're good to go.

In the example above, there's two queries, one for a point and one for a shape. The Map View displays them both, and you can even deactive one or the other in the table on the right.

Very convenient in my work, I say.

References

[1] ThatJeffSmith - Visualize Spatial Data with SQL Developer
https://www.thatjeffsmith.com/archive/2011/12/visualize-spatial-data-with-sql-developer/

Wednesday 3 February 2021

Using CDI to extend functionality

I recently wanted to change the behaviour of the framework.

Now, usually this means having to change code in the framework, but as this is something I'd rather not do, I found a way around this.

The framework, just as the code I write, uses CDI.

So it was a simple case of telling CDI to inject my Bean, instead of the Framework Bean.

And it worked right out of the box.

I was pretty surprised.

References

Contexts & Dependency Injection for Java
http://cdi-spec.org/