Saturday, 30 January 2016

Announcing: mapguide-rest 1.0 RC4

Here's the 4th (and I am most certain, the last) release candidate of mapguide-rest 1.0

Here's what's new in this release

CORS support

CORS support has been added, allowing for cross-domain AJAX requests to be made to mapguide-rest. This is opt-in and has to be enabled by un-commenting the MapGuide.Cors section in config.php

New Selection APIs

New APIs have been added to make it easier to work with selections

You can see these APIs in action with the updated kitchen sink sample application

Updated Swagger UI

The version of swagger UI and spec we use has been updated. Where possible JSON/XML content parameters have an associated model schema giving you an idea of how the content should be structured

Other Changes


Wednesday, 2 December 2015

Announcing: mapguide-rest 1.0 RC3

Here is the long awaited 3rd release candidate of mapguide-rest 1.0.

The main new feature (yeah, probably went a bit too early with that "release candidate" label) is a new set of APIs to:

  • Easily manipulate layer/group structure of a runtime map
  • Easily manipulate map selections non-spatially through a more simpler selection XML syntax
Which is demonstrated in various new sample applications included in this release.

Firstly, we have a new cesium.js sample demonstrating how to consume a mapguide-rest XYZ tile set using the new UrlTemplateImageryProvider

We also have a new example using the turf.js geometry library for slicing and dicing GeoJSON map selections client-side, which can then be saved server-side into a session-based layer and be incorporated into the map itself.

Since our sample applications use both OpenLayers 3 and cesium, we've also have an XYZ tile sample that uses both thanks to the ol3-cesium integration library.

And there's many more sample applications to try out. (NOTE: The vector tile example is broken in this release, I'm looking to fix that in the next release)

Other changes in this release include:
  • The whitelist configuration introduced in the previous release, is now extended to cover resource service APIs as well
  • Fix inability to walk nested directory structures for data publishing configuration files
  • Allow anonymous access to feature aggregate API
  • Allow custom root directory for storing XYZ tiles
  • Classify MgConnectionFailedException as a HTTP 503 error
  • The selected features route can be restricted to certain property names like the other routes that return feature data
  • XYZ tiles (not served from a Tile Set Definition) should no longer have labels/symbology anomalies at tile boundaries as mapguide-rest now renders out "buffered" XYZ tiles and crop the result to the original 256x256 size
  • GeoJSON output now covers the full set of supported geometry types
I'm certain this release will be the last one before I put the final 1.0 stamp on it. Other than documentation cleanup, and some performance testing I do not see anything of a show-stopping nature that impedes me from making the next release the 1.0 final release.

Friday, 20 November 2015

Write MapGuide application once. Run MapGuide application anywhere?

MapGuide is a very flexible development platform, allowing you to build your MapGuide applications in either .net, PHP or Java.

Depending on your OS, you currently have the following development/deployment options:
  • Deploy .net or PHP on IIS
  • Deploy PHP or Java (in a Tomcat Servlet container) on Apache HTTPD
But what if we could be even more flexible than that? What if you deploy to any platform regardless of whether your application is .net, Java or PHP.

We now have the components that can make this a possibility.
  • .net is now cross-platform. The canonical recommended deployment strategy of 5 applications is done through hosting the application via the Kestrel HTTP server, and reverse-proxying to it from a more industrial-strength HTTP server.
  • The HttpPlatformHandler module for IIS allows it to do process management and request proxying for other http listeners (like Tomcat or Kestrel), making it possible for IIS to "host" Java or .net Core applications.
So regardless of whether you're on .net*, PHP or Java we now have the means to deploy and host it on both Windows and Linux.

* Yes, there's a small caveat in this idealized scenario. It requires:
  1. A CoreCLR-compatible wrapper for the MapGuide API. This is something I'm playing around with at the moment.
  2. Your .net MapGuide application basically has to target the .net Core profile (and not the full .net Framework) in order to take advantage of the cross-platform deployment scenario.
  3. That we can reverse-proxy to Kestrel from Apache HTTPD. The official documentation refer to nginx as the front-facing web server, but if the ability to reverse proxy is the sole requirement, then any web server that has the capability can be the front-facing web server and not just nginx.

Thursday, 19 November 2015

Making the mapagent serve more useful looking JSON

Let's make that SELECTFEATURES mapagent operation a bit more useful!

Tuesday, 3 November 2015

MapGuide tidbits: Improving bundled PHP performance

NOTE: This tip only applies to PHP that is bundled with MapGuide Open Source 2.6 and newer.

MapGuide Open Source 2.6 and newer bundles the 5.5.x series of PHP, which includes a new opcode caching feature. Opcode caching can reduce execution times by upwards of 50% (as is the case with our mapguide-rest functional test suite which usually took around 6 minutes to run, but now runs in just over 3 minutes with opcode caching enabled)

In the interest of playing it safe, we didn't activate this feature in the default php.ini that's bundled with MapGuide. So if you want to activate this feature, you'll have to edit php.ini and add the following lines:

;Enable the opcode caching extensions
;On Linux, the path should be

;Some default opcode caching options. Adjust as necessary

Save the file (and restart the web server to re-jig PHP if required) and enjoy your faster PHP scripts!

UPDATE (18 Nov): Upon further testing, I've been finding that PHP opcache is horribly unstable on Windows (see this and this). So enable this feature at your own peril!

Thursday, 8 October 2015

MapGuide tidbits: Large directories of SHP files

Did you know that the SHP FDO provider included with MapGuide Open Source 3.0 now supports the family of FDO APIs introduced with RFC 23?

What this means is if you have a Feature Source that connects to a directory of SHP files, you should see dramatic performance improvements in walking schemas and class definitions of that feature source if that directory contained lots of SHP files. How does this work?

  • GetSchemaNames only has to return the schema name which will always be "Default". No disk I/O necessary
  • GetClassNames only has to return a class name list based on the file listing of the connected directory as each Feature Class name is basically the name of the SHP file (without the .shp extension). Previously, this would build the FDO logical schema from every SHP file in that directory and then return the class name list of that. Building that logical schema means connecting and inspecting every SHP file. For a directory with lots of SHP files, that takes a lot of time.
  • DescribeSchema with class name hint just means instead of constructing the FDO logical schema of every SHP file in that directory, we just do it for the list of SHP files indicated by the class name list (once again, because SHP class name = SHP file name)
  • GetClassDefinition does not require a full DescribeSchema first, as the parameters passed to it now contain enough information to know which physical SHP file to inspect and create the necessary class definition from it.
In practical terms, the performance gains will be most apparent on:
  • Editing SHP-based Layers in Maestro because the schema/class listing operations are now super cheap and fast.
  • Any code in your application or MapGuide Server that needs to access a single class definition from a feature source. In the past without these APIs supported, a full schema walk on the SHP feature source was required first in order to pluck out the necessary class definition from within it. This would be most noticeable performance wise when a request for a given class is made the first time. Subsequent times would be near instant due to caching, but for directories of many SHP files that first request could take a while.

Friday, 7 August 2015

Announcing: MapGuide Open Source 2.6.1

Here's a long overdue point release update for the 2.6 series of MapGuide Open Source.

There's plenty of useful bug fixes in this release (including a long overdue fix for WMS GETFEATUREINFO), and is a recommended upgrade from 2.6.

All the fixes in question can be found in the release notes below.

2.6.1 Download/Release Notes

Equivalent versions of MapGuide NuGet packages have also been uploaded to (remember to use the -Version flag to pull down this specific version when using Install-Packge)