OSGeo Planet

GeoSolutions: Developer’s Corner: Cartographic Rendering Improvements in GeoServer

OSGeo Planet - 3 hours 1 min ago


Dear reader, today we would like to share some recent improvements in GeoServer cartographich rendering, which will be useful for everybody, but great for those dealing with roads mapping. The first one is z-order control, in GeoServer 2.8 there are two new FeatureTypeStyle VendorOption allowing to control in which order the features get painted, inside a single layer, or even across layers. Here is an example from our user guide, where over and under passes, as well as rail bridges, are properly honored in the map rendering: [caption id="attachment_2397" align="aligncenter" width="600"]roads-group Z-Order Control at work with OSM Data[/caption] This is made possible by specifying the following two vendor options in all FeatureTypeStyle involved in the above map (as you can see, there is extensive use of road casing, so expect to find several FeatureTypeStyle elements in the style): <FeatureTypeStyle>    <!-- rules here -->    ...    <VendorOption name="sortBy">z_order</VendorOption>    <VendorOption name="sortByGroup">roadsGropu</VendorOption> </FeatureTypeStyle> The second important improvement is to leverage the SLD ability to specify multiple fonts in a more dynamic way. Up until now, the list of fonts was scanned and the first available font was used, resulting in a static decision before rendering the labels. Now, if there are multiple fonts, they are tried in turn to check if thet can actually render a certain label: if a map labels have multiple scripts they can now be seamlessly rendered without having to find a single font that can render all type of scripts (which might be a difficult proposition if your map contains all possible scripts, like OSM). Even better, if a single label contains multiple scripts, the different fonts will be used in turn for the different parts of the label. Here is an example over Hong Kong: [caption id="attachment_2400" align="aligncenter" width="556"]Selezione_072 Advanced rendering for OSM data over Hong Kong[/caption] The style contains two fonts, "Droid Sans", which renders many common scripts, but not traditional Chinese, and "Droid Sans Fallback", which instead contains the traditional Chinese glyphs:  <Rule> <MaxScaleDenominator>32000</MaxScaleDenominator> <TextSymbolizer> <Label> <ogc:PropertyName>name</ogc:PropertyName> </Label> <Font> <CssParameter name="font-family">Droid Sans</CssParameter> <CssParameter name="font-style">Normal</CssParameter> <CssParameter name="font-size">14</CssParameter> </Font> <Font> <CssParameter name="font-family">Droid Sans Fallback</CssParameter> <CssParameter name="font-style">Normal</CssParameter> <CssParameter name="font-size">14</CssParameter> </Font> <LabelPlacement> <LinePlacement> </LinePlacement> </LabelPlacement> <Halo> <Radius> <ogc:Literal>2</ogc:Literal> </Radius> <Fill> <CssParameter name="fill">#FFFFFF</CssParameter> <CssParameter name="fill-opacity">0.85</CssParameter> </Fill> </Halo> <Fill> <CssParameter name="fill">#000000</CssParameter> </Fill> <VendorOption name="group">true</VendorOption> <VendorOption name="followLine">true</VendorOption> </TextSymbolizer> </Rule>   Both of this improvements have been sponsored by DLR under via a enterprise support contract. Finally, let's see an improvement recently developed and donated by IGN to the community, which will make many happy: better space reservation in the conflict resolution engine for tilted or line following labels. In particular, for this class of labels the space reservation is made on a char by char basis, instead of reserving the entire bounding box covering the label.  Here is a "before and after" comparison: [caption id="attachment_2401" align="aligncenter" width="254"]Letter reservation - conflict Entire label bbox occupancy VS single char occupancy bbox[/caption] This in turn results in a significantly denser labelling on road networks, for example, here is our sample layer nyc:roads after the cure: [caption id="attachment_2402" align="aligncenter" width="475"]tiger-tiger_roads (1) Denser labels, thanks IGN![/caption]     If you want to know more about how we can help your organization, don't hesitate and get in touch with us! The GeoSolutions Team, Geosolutions
Categories: OSGeo Planet

Antonio Santiago: How to read from a writable stream (http.ServerResponse) in Node

OSGeo Planet - 19 hours 2 min ago

I'm working on a personal side project (when I have free time to spend on) where a bunch of middlewares are chained to do something awesome (Take a look at ClydeIO. Note it is currently a proof of concept). Remember a middleware is nothing more than a function that receives three parameters: the request, the response and the next function:

Categories: OSGeo Planet

GeoTools Team: GeoTools Datastore Workshop at FOSS4G

OSGeo Planet - Mon, 2015-08-31 16:24
There is still just time to register for the GeoTools Datastore workshop that is being presented at the FOSS4G conference in Seoul next month. The workshop is in the morning of 14th September and covers how to extend GeoTools with your own custom “DataStore” format. This course will take a detailed look at how vector data is handled. For an implementer GeoTools provides facilities for automatic handling of advanced functionality: thread safety, transactions with rollback and dynamic reprojection.

This is a Java Development workshop - so not only can you bring your own device - you can bring your own IDE. One instructor will be using Eclipse and the other Netbeans (command line and vi welcome).

You will leave this course with a custom “DataStore” implementation that can be dropped into an application such as GeoServer, and all the knowledge that you need to implement your own custom datastores in the future.

Categories: OSGeo Planet

GeoServer Team: GeoServer 2.8-beta released

OSGeo Planet - Mon, 2015-08-31 14:47

We are happy to announce the release of GeoServer 2.8-beta. Downloads are available (zipwardmg and exe) along with docs and extensions.

GeoServer 2.8 has a wide range of new features, behind the scenes changes, and a several of important security updates. This is beta release of GeoServer made in conjunction with GeoTools 14-beta.

This beta release is made available for collaboration with our user list (and is not intended for production). The beta release marks the of a feature freeze, we appreciate any and all testing during this period as we prepare for a September release.

New capabilities:

Fixes and improvements:

  • Significant increase in GML 3.X encoding speed
  • Pretty print option for style REST API
  • Allow environment variables to be used in freemarker template files
  • GeoWebCache parameter filters can now be set via GUI
  • INSPIRE metadata entry is now more forgiving and can be entered on a layer by layer basis
  • Fix for XXE security vulnerability has been revised and now functions in a JBoss environment
  • Faster startup for installations with large number of Oracle layers
  • The CSV output format can now handle WFS GetFeature join results (will transparently flatten the joined features)

Internal changes:

  • JAI-Ext integration for geospatial specific image processing operations, adding direct support for NODATA in raster sources. Disabled by default, needs to be enabled using a system variable.
  • Replacement of vecmath with EJML matrix library
  • Due to license restrictions the oracle extension no longer includes an Oracle JDBC driver, see the user guide for manual install instructions.

Community update:

  • We would like to welcome Stefano Costa (GeoSolutions) as a new committer!
  • Developers guide refresh covering release cycle, updating PSC members, and fixing tutorials
  • Responsible disclosure expectations covered on the website and user guide

See release notes for more information.

Thanks to Jody (Boundless) for publishing this beta, and the entire GeoServer team for an enormous effort bringing this release together.

About GeoServer 2.8

GeoServer 2.8 is scheduled for September release. For more information:

For additional details see the 2.8-beta and 2.8-M0 release notes.

New Community Modules

In addition to the formal GeoServer 2.8 release our code base has a community area for ideas an experimentation:

  • WCS and WPS output formats based on gdal_translate to provide a greater range of output formats
  • Embedded GeoFence server, REST API and GUI is the result of a productive collaboration between GeoSolutions and Boundless offering greater rule-based control of GeoServer security
  • MongoDB DataStore enabling GeoServer to publish from this popular JSON based document database (no zip packaging, needs volunteer)

Community modules should be considered a work-in-progress and are subject to quality assurance, documentation IP checks and a maintainer before being considered ready for release.

Categories: OSGeo Planet

Nathan Woodrow: UI theme support now core in QGIS

OSGeo Planet - Sat, 2015-08-29 02:41

I enjoy using the dark UI theme for QGIS so much I figured why not make it a core feature. In the next version of QGIS if you head to the options screen you can now find a UI Theme option.

Options | General_037

The default dark theme is called Night Mapping for all those late night mapping jobs that you do, or if you just like dark UI themes.

QGIS b789fab_029



Something you will notice with this theme is the custom icons for the layer visibility. Pretty nifty! Here is how it is done

Creating new themes

To create a new theme simply make a new folder in .qgis2\themes\ with the name of the theme you want and create a style.qss file inside there. Check out the default themes for an example

Follow the Qt style sheet guides to see what can be styled.

Something I have added on top of the normal style sheets is variable support. Variables can be declared in a variables.qss file in the theme folder.

Here is an example of some variables:

@background: #323232 @text: #aaa @selection: #507098 @menuback: #444 @highlight: #ffaa00

Now in style.qss we can do this:

QWidget { color: @text; background-color: @background; }

Great for not having to repeat your self or quick updating in a single place. When the theme is applied via the Options dialog or via the API it will replace the variables in style.qss using variables.qss. The result file is called style.qss.auto

Needs some tweaks

The default dark theme is a collection of stuff I have found around the net and stuff I have added myself. It’s far from prefect and I would love help to make it the best dark theme for QGIS. If you have another theme you think would make a good default one open a pull request on GitHub


Filed under: Open Source, qgis Tagged: qgis
Categories: OSGeo Planet

Micha Silver: QGIS fighting bugs – Part 2

OSGeo Planet - Fri, 2015-08-28 16:33

Continuing my previous post I’ll now show how QGIS can serve as a front end to Spatialite based tables. We cover styling features with attributes from the database, and how to add new data rows to a non-spatial data table.

I’m presenting this post as a YouTube video. If you did not yet download the demo I suggest you get it before viewing, so it will be easier to follow the techniques. After adding the Spatialite layers into QGIS, we use attribute columns to stylize the point location markers, including data defined styles. Then we see how to add a non-spatial table of insect capture data, and to add new data rows. Finally we see how these edits are immediately viewable on the map as different sized point symbols representing pest infestation.

Categories: OSGeo Planet

Just van den Broecke: GPS Hiking and The Evolution of Navigation

OSGeo Planet - Wed, 2015-08-26 11:56

On sunday August 25, 2015 I provided a talk/workshop for a local knowledge network of friends and acquaintances in Amsterdam. TLDR; see gps.justobjects.nl.  Originally, I would talk about “Hiking with GPS”. But as I started pondering about this subject I decided to broaden the content to include also the evolution of navigation. My reasoning was:

  • by using GPS we unlearn navigational skills such as compass and map reading
  • my personal interest in human evolution for example the route humans followed out of Africa

Routes (red) of Homo Sapiens out of Africa to populate the World

So I combined all these elements into a new title/subject “GPS Hiking and The Evolution of Navigation”. See also these slides.

Natural Navigation
I was already reading and practicing the intriguing art of Natural Navigation which in short allows one to find direction without any device nor map. By reading and interpreting signs of nature one can determine direction, i.e. where The North is.

Natural Navigation is not just about finding direction by sun, moon and stars, but in particular by interpreting our natural surroundings, i.e. the land, the plants, the trees and animals. Natural forces shape these surroundings, making them asymmetric under the influence of their prevailing forces. This asymmetry in nature provides clues for example where the North is.

 The Natural Navigator, Gooley)

Left tree shaped by wind, right by the sun (src: The Natural Navigator, Gooley)

For instance: sun, rain and wind strongly shape the direction that trees and their branches grow. A prevailing south-western wind will bend trees slightly north-east.

But also mosses and lichen on trees give clues about direction. This has saved me once in finding my way when hiking on a cloudy day without GPS and an emptying smartphone.

To get started with Natural Navigation I recommend the books by Tristan Gooley via www.naturalnavigator.com.

The Natural Navigator by Tristan Gooley

The Natural Navigator by Tristan Gooley

I am also intrigued in how early humans navigated. As hunter/gatherers we had to cross enormous stretches of land, often going far out from a base camp for a hunt or food collection. Did these first humans use dogs for navigation, made landmarks?They sure must have been masters at Natural Navigation. We can get some clues from indigenous people today. Years ago I read a fascinating book “The Songlines” by Bruce Chatwin, which in short told how Australian Aboriginals could navigate throughout their continent, or as Wikipedia explains:

“Within the animist belief system of Indigenous Australians, a songline, also called dreaming track, is one of the paths across the land which mark the route followed by localised ‘creator-beings’ during the Dreaming (creation time, JvdB). The paths of the songlines are recorded in traditional songs, stories, dance, and painting.


A knowledgeable person is able to navigate across the land by repeating the words of the song, which describe the location of landmarks, waterholes, and other natural phenomena.”

Going Outdoors


GeoCaching and Natural Navigation

We ended the session by doing an exercise with both Natural Navigation and following a route and GeoCaching with GPS. Here my Map5.nl NLTopo App appeared useful for those without GPS.


The Route and Caches in the Map5.nl NLTopo App


It was fun afternoon, maybe something to reenact in another setting. Let me know if you are interested.

You can find the landing page of this talk/workshop at gps.justobjects.nl and slides on Slideshare. In Dutch but you may view the page via Google Translate.

Categories: OSGeo Planet

GIS for Thought: UK Postcode Format Breakdown

OSGeo Planet - Wed, 2015-08-26 11:00

UK postcodes are broken down/divided into 4 levels: Areas, Districts, Sectors, and Units.

For G12 8QH the breakdown is:
Area – G
District – G12
Sector – G12 8
Unit – G12 8QH


Geographically this breaks down as:

Categories: OSGeo Planet

From GIS to Remote Sensing: Minor Update: Semi-Automatic Classification Plugin v. 4.7.11

OSGeo Planet - Tue, 2015-08-25 19:34
This post is about a minor update for the Semi-Automatic Classification Plugin for QGIS, version 4.7.11.

Following the changelog:
- improvements in raster compression
Categories: OSGeo Planet

Andrés Maneiro: DEFRA libera datos LIDAR

OSGeo Planet - Tue, 2015-08-25 06:22

El departamento de medioambiente, alimentación y desarrollo rural de Reino Unido (DEFRA) va a publicar sus datos como open data. Entre los primeros están los datos LIDAR, que cubren una extensión de casi el 75% del país.

Categories: OSGeo Planet

GeoSpatial Camptocamp: Animating maps with OpenLayers 3

OSGeo Planet - Mon, 2015-08-24 13:32

OpenLayers 3 maps are not just static map: the rich functionality of the library provides the tools to create fully interactive maps that engage with the user. Animations are a great technique to enrich the user experience and to visualize your data in a beautiful way. In this blog post we are going to show how to build an OpenLayers 3 map that animates flight routes between airports.

The result will look like this:


The demo is available here.

In the following section, we will walk you through the steps to create this map.

We start with a simple map with just one background layer with a clean style.

The data set for the flight routes is provided by OpenFlights. We are using a simplified extract as JSON file. The file contains a list of coordinate pairs, the first coordinate being the source airport and the second coordinate being the destination airport. With the two coordinate pairs, we will create a great circle path between the two airports using the JavaScript library arc.js.

The JSON file with the flight data is not a standard geo data format, so we can not use one of the data formats of OpenLayers to load the data. Instead we read the JSON file using jQuery, calculate a great circle path for each flight and then manually create a feature and add it to a vector source. The features of the source are shown in a vector layer which is added to the map.

In the callback of the AJAX request we loop through the list of coordinate pairs and calculate a great circle line for each flight route between two airports. The coordinates of the resulting line string are in EPSG:4326. Usually, when loading vector data with a different projection, OpenLayers will automatically re-project the geometries to the projection of the map. Because we are loading loading the data ourself, we manually have to transform the line to EPSG:3857. With the re-projected line string geometry we create a feature. Then we could add the feature to the vector source. But to delay the start of the animation of a flight, so that not all animations start at the same time, we add the feature with a timeout.

The actual animation of the flights is done in a postcompose listener. The postcompose hook allows to intervene with the OpenLayers rendering process and enables to directly draw geometries onto the canvas context. A postcompose listener is called for every rendering frame and is the perfect place to implement animations.

In our case, we want to animate a flight path to simulate the movement of an airplane. We will do this by revealing the line geometry step by step. E.g. the first time a flight path is rendered, the first 2 points of the line are shown, in the next render frame the first 4 points of the line are rendered, then 6, … The speed of the airplane, that is how many points are revealed per second, can be configured.

In the function animateFlights, which we use as postcompose handler, we loop through the list of flight features and draw the features. In animateFlights we only draw the geometries of those features that are still being animated. Once the animation for a flight has finished (that is the airplane has reached its target), the feature will be rendered by the default layer style. A finished flag on the feature indicates if the animation has terminated.

To draw the geometry of a flight, we need to build a sub-line from the start of the flight to the current position of the airplane. To do this we first calculate the elapsed time from the start of the animation of this particular feature. With the elapsed time and the speed (the number of points that are revealed per second) we get the number of points that should be rendered for a line at the current time. Then, we build a linestring for the sub-set of points and directly draw the line with the vector context.

That’s it! The full code of the example is available here.

We hope that this example gives you an idea on how maps can be animated with OpenLayers 3. We are curious to see the animations that you build with this technique!

Feel free to contact us if you are interested in animating your data with OpenLayers 3. Also meet us at the FOSS4G conference in Seoul.

Cet article Animating maps with OpenLayers 3 est apparu en premier sur Camptocamp.

Categories: OSGeo Planet

gvSIG Team: 7as Jornadas gvSIG LAC: Información actualizada

OSGeo Planet - Sun, 2015-08-23 23:03

Como todos sabréis esta semana son las 7as Jornadas gvSIG de Latinoamérica y Caribe. Un evento que viene cargado de actividades. A las habituales sesiones de ponencias y pósteres, se une un número de talleres mayor del de cualquier otro año: talleres de desarrollo en java, de scripting, de introducción a nuevos usuarios, aplicados a distintas temáticas…(en este mismo blog podéis encontrar información de lo que veremos en todos los talleres).

Se ha confeccionado un PDF con toda la información actualizada de las actividades y que podéis consultar en este link.

Y para calentar motores, los días previos a las jornadas se van a realizar distintas actividades de difusión de gvSIG, tanto en Toluca como en DF:

  • Lunes 24:
    • Conferencia “Geomática libre, soberanía tecnológica y tendencias en la gestión del territorio” organizada por el Instituto de Geografía-UNAM.
    • Conferencia sobre geomática libre para la Facultad de Planeación de la UAEM -por la mañana- y para los alumnos de la Maestría en Análisis Espacial y Geoinformática -por la tarde-.
    • Taller de programación java en gvSIG para los alumnos de geoinformática de la UAEM.
    • Taller de scripting con python en gvSIG para alumnos de Postgrado / Especialidad en Cartografía Automatizada, Teledetección y Sistemas de Información Geográfica.
  • Martes 25.
    • Taller “Introducción a gvSIG 2.2, novedades y manejo del SIG libre” organizado por el Instituto de Geografía-UNAM.
    • Conferencia “Tecnología, Administración Pública y Sectores Estratégicos. Uso de los Sistemas de Información Geográfica (SIG) en la gestión pública. Casos de éxito” para el Gobierno del Estado de México.
    • Taller de programación java en gvSIG para los alumnos de Postgrado / Especialidad en Cartografía Automatizada, Teledetección y Sistemas de Información Geográfica.

¡¡Y el miércoles comienzan las Jornadas!!

Desarrollo de software libre como motor de cambio. No faltes, forma parte del cambio.

Filed under: events, gvNIX, gvSIG Desktop, spanish Tagged: 7as LAC, Programa
Categories: OSGeo Planet

Micha Silver: QGIS fighting bugs

OSGeo Planet - Sat, 2015-08-22 14:02
Real bugs, agricultural pests, cause damages to food production throughout the world. GIS techniques can help in monitoring pest infestation by collecting and mapping data from traps, baited with pheromone lures. QGIS when teamed up with Spatialite makes the ideal combination for pest control programs to maintain and display the distribution of different species of insects. Here’s how it’s done.
Pest control programs often require, at minimum, collecting capture data at static trap locations but over extended time periods. The translation of this real world concept to a spatial database suggests two tables:
  • a spatial table of trap point locations, mostly static, with a unique identifier for each trap.
  • and a second table of alpha-numeric data, where each row contains a timestamp when the trap was inspected, a count of how many insects and of what species were found, and the trap identifier, that must point back to the traps spatial table.
Setting up these two tables in a spatial database, such as Spatialite is simple. The generic SQL construct for creating a database table is:
CREATE TABLE "table_name" ("col_name" type,"col_name" type);.
So the statements we need look like: --- Create tables for traps and inspections CREATE TABLE traps (trap_id text PRIMARY KEY NOT NULL UNIQUE, trap_type text, lure text, host text, longitude double, latitude double, place_date date); SELECT AddGeometryColumn('traps','geometry',4326,'POINT',2); CREATE TABLE inspections (inspect_id integer PRIMARY KEY AUTOINCREMENT, trap_id text references traps(trap_id), inspect_date date, species text, num_males integer, num_females integer, interval integer); The first CREATE statement builds the layer for traps, with the “trap_id” declared as a text field and it serves as the primary key. We also set the initial placement date for the trap. This will become important soon when we move on to the capture data. Next comes the AddGeometryColumn(...) function. This makes the traps table spatial by performing three crucial tasks: the geometry column is added to the traps table, the table is added into the system metadata known as “geometry_columns”, and certain constraints are setup on the traps table to enforce that all new features are indeed POINT features, and that they are in the CRS that we declared, EPSG code 4326. If you are working in some other projection system, then the EPSG code declared in the third parameter of AddGeometryColumns(...) must be chosen to match your CRS.
The second CREATE defines the table for dynamic trap inspections. Note the references declaration on trap_id. This applies a foreign key constraint to the trap_id column, so that every item of inspection data must reference a trap_id that actually exists in the traps table. Also, we setup the inspect_id primary key as AUTOINCREMENT so that the database adds sequential integers automatically.

Next we implement an important concept in agricultural pest monitoring. Pest infestation is usually expressed as Flies per Trap per Day, or FTD. In order to create this metric automatically we do two additional steps.
The first step involves a database TRIGGER. We want our database to calculate for each entry of inspection data the interval in days between this new entry and the last entry on that trap, and with the same species. We do this with a trigger function. More background on trigger functions is available on the Sqlite website. Here’s the code we use: --- Trigger function to update interval column on each insert --- Automatically sets the interval in days since last inspection --- When an inspection date is entered earlier than any other inspection --- for the trap/species combination then the first date is taken --- from the place_date of that trap CREATE TRIGGER update_inspection_interval AFTER INSERT ON inspections BEGIN UPDATE inspections SET interval = CASE WHEN (SELECT COUNT(*) FROM inspections i WHERE i.inspect_date<NEW.inspect_date AND i.species=NEW.species AND i.trap_id=NEW.trap_id)==0 THEN (SELECT julianday(t1.inspect_date)-julianday(t2.place_date) FROM inspections t1 JOIN traps t2 ON t1.trap_id=t2.trap_id WHERE t1.inspect_id=inspections.inspect_id) ELSE (SELECT julianday(t1.inspect_date) - MAX(julianday(t2.inspect_date)) FROM inspections t1 JOIN inspections t2 ON t1.trap_id = t2.trap_id WHERE t1.inspect_date > t2.inspect_date AND t1.species = t2.species AND t1.inspect_id = NEW.inspect_id) END WHERE inspect_id = NEW.inspect_id; END; Looks complicated, but when we split the statement into parts, all will become clear. The first line creates the trigger on the table inspections and sets it to run after each new insert. This means that when the trigger’s UPDATE runs, we already will have access to the new row of data that was just inserted. The outer UPDATE clause is terminated, at the line before the last with the WHERE expression: WHERE inspect_id = NEW.inspect_id;. This says to update only the row with the new inspect_id.
Within the update statement we have addressed two separate cases: calculating the interval when this is the very first inspection of the trap, so there is no earlier inspect_date, and all other inspections when we do have an earlier date. Separation of two cases is accomplished using the CASE...WHEN...THEN...ELSE... expression. Within the WHEN clause we count how many rows in the inspections table have dates earlier than the newly inserted row, with the same trap and same species. If this count is zero, then this is the first inspection of the season, so we go to the traps table, aliased as “t2” and extract the initial placement date of the trap. Recall from the create table that we added a place_date column for each trap. When the trap is inspected for the first time, we set the interval as number of days since the trap was originally placed. We chose the correct trap by doing a JOIN between the traps table and the inspections using the trap_id as the common key.
In all other cases, the trigger function goes back through the inspections table and searches, using the WHERE clauses, for rows with an earlier date. This is done by comparing, or doing a JOIN between two instances of the same table, called “t1” and “t2”. This practice is common when we need to evaluate data from different rows in the same table. The JOIN between the two instances of the inspections table is on the trap_id column. The clause WHERE t1.inspect_date > t2.inspect_date insures that we are comparing the same trap but from an earlier date, and the same species is found with the help of: AND t1.species = t2.species.
In both cases we use the unexpected function julianday() which returns the number of days since Jan 1, 4713 BCE. Subtracting the Julian Day of the previous inspection from the Julian Day of the current inspection is a simple way to get the interval in days.

We have one last step to reach FTD for each trap/species combination. We obviously need to divide the count of captures by the interval to get FTD. Since this is dynamically changing information, the recommended approach is a database VIEW. A thorough explanation of spatial VIEWs appears in the Spatialite Cookbook. This VIEW will be spatial in that it contains the geometry for each trap, but also the inspection date, species and the calculated FTD as “number of captures/interval” from the inspections table. Here’s the SQL expression to create a sample VIEW:
--- This VIEW is created as a spatial POINT feature for display in QGIS --- The VIEW contains columns with "FTD Males" and FTD Females" --- as well as inspection date --- So they can be filtered in QGIS for displaying data for specific dates CREATE VIEW capitata_ftd AS SELECT t1.ROWID AS rowid, t1.trap_id, t1.inspect_date, CAST(CAST(t1.num_males AS REAL)/t1.interval AS REAL) AS "FTD Males", CAST(CAST(t1.num_females AS REAL)/t1.interval AS REAL) AS "FTD females", t2.trap_type, t2.geometry FROM inspections t1 JOIN traps t2 ON t1.trap_id = t2.trap_id WHERE t1.species='C.capitata'; --- Add VIEW metadata INSERT INTO views_geometry_columns (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column, read_only) VALUES ('capitata_ftd','geometry','rowid','traps','geometry',1); In the created VIEW, the virtual columns “FTD Males” and “FTD Females” are calculated on the fly. Since both the interval (days) and the num_males and num_females are integers, we add the CAST keyword to force FTD to be a real number. The VIEW above filters out the species Ceratitis capitata. Additional VIEWs can be created in a similar way for each species of pest in the database. Each row in the VIEW will contain the trap_id, inspection date, calculated FTD, and also the geometry. The rowid column is required by QGIS for displaying spatial views. The final INSERT INTO views_geometry_columns... statement sets up the required items in the Spatialite metadata table for viewing in QGIS, which I’ll present in the next installment.
You can download an SQL script file “create_pests_db.sql” with the above set of SQL commands from here. Within Spatialite-gui, click “Execute an SQL script”, and point to this script file to create a new, empty Spatialite database exactly as above. The downloaded zip file also contains a pest.sqlite database already populated with data (traps and inspections) and a QGIS project file using that Spatialite database.
Categories: OSGeo Planet

Martin Davis: SliceGraphs in JEQL

OSGeo Planet - Fri, 2015-08-21 22:19
In the interests of increasing blog output, I'm going to experiment with using a terser style in posts where the content is mostly self-explanatory.  Sort of an embedded microblog...
Inspiration: original Population Lines print , this plot from the Line Graphs in R blog post:

Data: SEDAC World Population grid, subsampled

JEQL script


Categories: OSGeo Planet

Martin Davis: Variable-Width Buffers in JTS

OSGeo Planet - Fri, 2015-08-21 14:58
Inspiration:  this post on the JSTS group (with an image - good job on requirements!)

JTS implementation: in the lab

Code:   Geometry geom = VariableWidthBuffer.buffer( line, 10, 80 );


Categories: OSGeo Planet

Jo Cook: Portable GIS 5.2

OSGeo Planet - Thu, 2015-08-20 18:16

I’m pleased to announce the latest release of Portable GIS. This version (v5.2) has only a couple of changes:

  • QGIS 2.8 (I’m going to try and do a release to coincide with each long-term release of QGIS)
  • Loader has been updated to the latest version

You can download the setup exe and the md5 checksum here.

Older versions are still available but have been archived to avoid confusion.

As always, please let me know of any problems via the Portable GIS google group.

This version also marks the start of an attempt to create a repository for Portable GIS, which will hold the additional and/or changed files and instructions for rolling your own version. This is something that I have wanted to do for some time, but it’s not ready for release yet. Watch this space!

Categories: OSGeo Planet

Boundless Blog: Announcing the Availability of OpenGeo Suite 4.7

OSGeo Planet - Thu, 2015-08-20 17:12

Today we’ve announced the immediate availability of OpenGeo Suite 4.7 – the press release hits the treetops of what’s included, so we’ll take the opportunity here to give a bit more color.

Support for GeoMesa

We’ve written in the past about support for GeoMesa, as recently as this past spring. What we’re seeing now is a clear trend of organizations struggling with their traditional relational databases (RDBMS). There is so much interesting data useful for GIS purposes that organizations are increasingly needing advanced data management strategies. So, we’re taking our own support of GeoMesa (and its underlying Apache Accumulo system) to the next step with a formally supported plugin for connection to GeoMesa data stores. Organizations who wish to use GeoMesa instances will now have a much easier and more reliable experience connecting their OpenGeo architecture.

WPS Builder

As GIS Professionals and Developers, the Q Score of our excitement about this feature is high. I reference here to understand the way things are prior to this release – not exactly an approach which makes advanced GIS accessible and friendly to an increasingly fragmented user audience. WPS Builder is a web-based UI that takes the next step in simplifying complicated processes, with the added upside that more professionals can now use WPS processes to improve what they can do with GIS.


We’re all-in on Composer – we strongly believe alternatives are needed across our industry for web-based styling and publishing tools. So, we’re continuing our efforts on Composer in this release. We think YSLD is very useful, so there are a lot of improvements in the experience crafting and editing the syntax. We’ve increased supported formats, made coloring easier to identify, and squashed bugs.

GeoServer Extension for AWS CloudWatch

There’s sticking stuff in the cloud as a VM and running it on somebody else’s iron, and then there’s really running stuff in the cloud. This new extension helps take GeoServer into the latter, by allowing more alignment between GeoServer and the elastic nature of the cloud. AWS Cloudwatch can now monitor load on GeoServer, helping users take advantage of the ability to scale systems up and down as needed.

Updates, Fixes, Etc.

Of course we wouldn’t be complete with any new release without fixing issues and updating supported systems. The most noteworthy is support for Java 8.

As always, all of these great features and the requisite support are available to Boundless customers. Please don’t hesitate to contact us to learn more.

The post Announcing the Availability of OpenGeo Suite 4.7 appeared first on Boundless.

Categories: OSGeo Planet

Nathan Woodrow: Mixing a bit of Excel into QGIS – conditional formatted table cells

OSGeo Planet - Thu, 2015-08-20 13:25

I was using Excel the other day and used the conditional formatting rules to style some cells based on a condition. If you have never seen or used them they look like this:

They are pretty handy for a quick idea on the state of your data.  Looking at QGIS I thought to myself “Wait!? Why not do that in QGIS too. That would be pretty neat”.  And with that here it is, finally!. Conditional formatting rules for QGIS attribute table.



You can control the font style, color, background color, even custom icons based on QGIS symbols. The buttons at the top give you access to quick styles which you can tweak more with the other options.

The conditions are just normal QGIS expressions. Use the special variable @value to refer to the current cell value. As they are normal QGIS expressions you can reference the other fields in the expressions.

(Click the GIF for a better view)


So go nuts. I would love to hear any feedback if you use it. Try it out in the next nightly dev build.

Filed under: Open Source
Categories: OSGeo Planet

SourcePole: Meet Sourcepole at FOSS4G Seoul and INTERGEO Stuttgart

OSGeo Planet - Thu, 2015-08-20 11:35

In four weeks, the FOSS4G Conference will start in Seoul, South Korea. Online registration is open until September 2nd, so it’s not too late for attending!


Our conference contributions:

  • Keynote from Marco Hugentobler about the QGIS project and its evolution from a desktop GIS to a GIS platform.


  • QGIS Plugin Development with Python (WS04)
  • OGC Webservices with QGIS (WS13)


  • New QGIS functions for power users, Marco Hugentobler
  • QGIS Plugins – From Must-Haves to insider tips, @PirminKalberer
  • Building an OpenLayers 3 map viewer with React, @PirminKalberer

If you want to know more about QGIS or other Open Source GIS products, meet us and our partners from Georepublic at the QGIS Enterprise exhibition booth.

We’re looking forward to meet you in Seoul!


In the same week, INTERGEO, the world’s leading conference trade fair for geodesy, geoinformation and land management takes place in Stuttgart, Germany.

You’ll find us together with our German partner Geoinformatikbüro Dassau at the QGIS Enterprise exhibition booth in Hall 4.

Categories: OSGeo Planet

GeoSpatial Camptocamp: Workshops and presentations at FOSS4G 2015

OSGeo Planet - Thu, 2015-08-20 06:56

FOSS4G 2015 in Seoul in coming up!

Camptocamp will give 2 workshops and 2 presentations.

  • « Build Your Own Data Portal Using GeoNetwork 3 » Sept. 15 AM, Florent Gravin (Camptocamp), Francois Xavier Prunayre (Titellus) and Jeroen Ticheler (Geocat BV)
    The workshop will focus on how to implement your own dedicated open source metadata catalog with GeoNetwork. Beyond the basic installation and administration of a single default GeoNetwork instance, participants will learn, during this workshop, to develop and build their customised catalog.
  •  »OpenLayers 3 », Sept. 15 AM, Eric Lemoine (Camptocamp) and Tom Schaub (Planet Labs)
    OpenLayers 3 is a full featured mapping toolkit for web application development. Version 3 is a complete rewrite of the library with a focus on performance, flexibility, and the latest browser tech. Understanding what’s in the library and how to use it in your applications is key to unlocking its potential. In this workshop, we’ll provide a comprehensive overview of OpenLayers 3.

The workshops detailed description and schedule is available here.

    • « OL3-Cesium: 3D for OpenLayers map », Guillaume Beraudo,  Sept. 16, 11:00-11:25
      OL3-Cesium is a new open-source Javascript library for easily adding a Cesium 3D globe to applications based on OpenLayers 3.  Topics of interest will include easy kick start of a project, 3D vector positioning on the terrain, 2D/3D interactions and streaming.
    • « ngeo: a companion library for OpenLayers 3 », Eric Lemoine, Sept. 17, 11:00-11:25
      ngeo provides a set of AngularJS « directives » and « services ». With ngeo, Camptocamp targets a library that is very flexible, functionally rich and of high quality.

The presentations preliminary programme is available here.

Looking forward to seeing you at the conferencce!

Cet article Workshops and presentations at FOSS4G 2015 est apparu en premier sur Camptocamp.

Categories: OSGeo Planet
Syndicate content