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)

Saturday, 1 August 2015

How can we take advantage of this?

Here's the facts:
  • MapGuide for the longest time has an FDO provider that can read SQLite databases
  • SQLite has an in-memory mode
  • :memory: is a completely valid file name to pass to the connection parameters of a SQLite FDO connection
  • In terms of I/O, memory is the fastest backing store you can have for direct data access.
Now how can we make MapGuide blazing fast (where it is currently not), given the above facts?

That question has been brewing in my mind for some time now.

Wednesday, 29 July 2015

A (Better) map viewer template

Based on blog and github stats, the bootstrap map viewer templates that I talked about in a previous post seemed to be the my most popular repo and 2nd most popular post of all time respectively. I'm glad you like it :)

But to tell the truth, I have since found something significantly better and in a humble case of acknowledging that someone made something better than what I have, suggest that you give it a try.

I am talking about Tobias Bienek's sidebar-v2 responsive map viewer template.

Just look at this screenshot!

This template is basically my dream responsive map viewer layout fully realized, which I've been trying to replicate for the longest time since I first heard of bootstrap.

A cursory glance at the repo shows that it's written in the most un-obtrusive of HTML, CSS and JavaScript which means actual integration of bootstrap-styled content should be a simple affair, and their examples already cover all the possible map viewer solutions you would ever use.

So if what I've made is less than desirable, give this template a go.

My favourite C# 6 trick

The nameof operator is awesome! Now even your string constants can be codified!

Between the nameof operator and localized string resources, you don't have much excuse anymore to use naked string literals.

Monday, 27 July 2015

My weekend project

Since Visual Studio 2015 was just released, I decided to have a play with Roslyn this weekend.

Check out them red squiggly lines!

400,000 pageviews!

Thank you for your continued eyeball patronage!