Reviews and Links for March 2012

By . Updated on

No books this month.

Links

RT @drclue: "drclue: #pearlhunt making progress... http://t.co/FAgLQ2UH" --http://www.twitter.com/drclue/status/185829093244280832

We won #pearlhunt and all we won was this... http://t.co/vUBgLWeK

Bald eagle, fox, and cat are porch friends - Boing Boing http://t.co/5WGciNLD via @BoingBoing

ITHCWY: Agua: Little known fact, geologists would tell you that Bernal Hill is made of chert, actually it's mostly… http://t.co/xMRm2J9n

ITHCWY: Mangler: I don't know what the machine attached to our office does but it's giving me nightmares. http://t.co/BSbvoshq

ITHCWY: It was where he left it: Not to bang on about the BBC and their horrible headlines but 'lost' is a bit… http://t.co/bDKjUbl4

ITHCWY: Executive Clubbing: I used to really love British Airways. I even got over their silly new livery and… http://t.co/NC2Bt9bM

ITHCWY: Sand Ladder at Fort Funston http://t.co/5aeQjoti

ITHCWY: SFO http://t.co/sB1QdXCt

BBC News - The Spanish link in cracking the Enigma code http://t.co/Qv6qYqqQ #fb

ITHCWY: Robot Ahead http://t.co/tn7mHTI8

ITHCWY: Goldilocks: Israel just banned models with a BMI under 18.5. That's not severely underweight, it's the… http://t.co/G5HCE5Ey

External impact report for @IDEX at http://t.co/BsMp8ADa

RT @CatfoodSoftware: Blog: Vernal (Spring) #Equinox 2012 in Catfood #Earth: Spring starts right now in the… http://t.co/xxnASTMp

Good weekend to skip Fort Funston: http://t.co/UE8blE4c

ITHCWY: Catfood: PdfScan 1.40: Catfood PdfScan 1.40 is a small bug fix release. PdfScan converts documents to PDFs… http://t.co/YXdMn6ux

RT @CatfoodSoftware: Blog: Catfood #PdfScan 1.40: I’ve just released Catfood PdfScan 1.40. This is a minor update… http://t.co/6bzjCdfi

Shamed... http://t.co/AlSwTzzY

ITHCWY: Three reasons the dream of a robot companion isn't over: David Lee reports from the Innorobo 2012… http://t.co/JndJZahn

ITHCWY: Fixing dropped wireless connection for Linksys E4200: I've been going quietly mad trying to fix a constant… http://t.co/VVZ2dl2m

Why is this firefighting robot familiar: http://t.co/rqXLfCdC vs. http://t.co/wCL3Hu2d US Navy, call Cybernetics #fb

RT @CatfoodSoftware: Blog: To Follow or Not To Follow: The Third Way: Mashable published an article by Christine… http://t.co/MEzWlryS

ITHCWY: Sweeney Ridge: Sweeney Ridge, starting from Skyline College and walking up to the Portola Expedition… http://t.co/g1HIms1F

ITHCWY: Upgrading to http://t.co/0gDd7HHJ 2.5: Today I upgraded this blog to the latest and greatest version of… http://t.co/HHDj7VdM

"not a threat to the penguins, we don't suspect" - http://t.co/oIrzQOEj - it wasn't a dream!

http://t.co/qRCS8Qhb (new #SF data portal) #todo @myEN

Time Zone Time Lapse

By . Updated on

Time Zone Time Lapse

The video below shows twenty-four hours from noon UTC to noon UTC on June 7, 2010 using webcams from the Catfood WebCamSaver database. It proves that I really will do anything to avoid finishing off the new Catfood web site.

You can probably figure out that the three blocks of cams are the US, Europe and Japan. The position doesn't reflect the latitude in this version, it's just a random selection of cams for the timezones represented in the database. As it's July and most of the cams are in the northern hemisphere you'll see long days and short nights. I'll try to remember to create an updated version around the autumnal equinox.

The program that generated the frames ended up being simpler than i thought. Because it's fetching images from a lot of different sources I had a timer creating and then saving a frame once a minute and lots of worker threads fetching the images. Each worker thread is assigned a frame number and once it's got the image it locks the main frame and tries to paints it's own area. If the frame number has moved on the image is abandoned. You can see some of the cams flickering on and off in the video — these went down while the frames were rendering or just took longer than a minute to respond.

ESRI Shapefile Reader in .NET

By . Updated on

ESRI Shapefile Reader in C#/.NET

Catfood.Shapefile is a .NET read-only, forward-only parser for Esri shapefiles. With Catfood.Shapefile it’s easy to enumerate all the shapes in a shapefile together with their metadata.

From version 2.00 Catfood.Shapefile is available via NuGet. It has also been migrated to .NET Standard 2.1. If you use an older version of .NET then you should continue using Catfood.Shapefile 1.60. The source code is on GitHub.

Esri (originally Environmental Systems Research Institute) shapefiles are a GIS (geographic information systems) file format that can store a wide variety of geographic information. I originally started working with these files to add country borders to Catfood Earth.

Shapefiles actually consist of a number of different files with different extensions. There are three mandatory extensions: .shp, .shx and .dbf and so a shapefile containing borders might be distributed as borders.shp, borders.shx and borders.dbf. The .shp file contains the actual shape data in vector format, often lines or polygons. The .shx file is an index to the shapes. Finally the .dbf file is a database of metadata associated with the shapes. Catfood.Shapefile requires only the .shp file for shape data and will provide metadata if at least the .dbf file is also available.

There are several optional extensions that might be included with a shapefile. .prj contains the geographical projection, .xml is an alternate metadata format, .sbn and .sbx index for spatial queries, and .cpg defines the code page used by the shapefile.

Here is some sample code for a .NET 6 console application to print basic information about a shapefile and the first point in the first polygon:

To use this, create a new console application, paste the code into Program.cs and add Catfood.Shapefile via NuGet.

The default constructor uses a database connection string that uses the Jet driver. This is only available for 32-bit applications and you will need to target Windows x86 to use it. An overload is available that allows you to specify a custom connection string to access metadata.

Catfood.Shapefile supports Null, Point, MultiPoint, PolyLine, PolyLineM and Polygon shapes. Three dimensional shapes (PointZ, PolyLineZ and PolygonZ) are not currently supported. There is also currently no support for writing shapefiles. If you add any of this please send a pull request on GitHub!

I am grateful to the developers who have contributed to Catfood.Shapefile over the years. Most are credited in the release notes below. If you need help or have feedback please leave a comment on this post.

Updates

Catfood.Shapefile.dll 1.10

I've just released v1.10 of my ESRI Shapefile Reader (Catfood.Shapefile.dll). This is a .NET 2.0 forward only parser for reading shapefile content.

Sharon Tickell was kind enough to report two bugs with suggested updates. These have both been fixed in 1.10.

While working on these fixes I also discovered that there are no 64-bit Jet drivers (since releasing the first version I've upgraded to a 64-bit box for development). This is an easy fix, just target any application using Catfood.Shapefile.dll at x86. I've updated the demo application accordingly.

Download Catfood.Shapefile.dll from GitHub.

ESRI Shapefile Library Update

I've just released a small update for my ESRI Shapefile Reader project on GitHub. The only change is a patch from SolutionMania that fixes a problem when the shapefile name is also a reserved name in the metadata database. The patch escapes the name preventing an exception from being thrown.

Catfood.Shapefile.dll is a .NET 2.0 forward only parser for reading an ESRI Shapefile. Download 1.20 from GitHub.

PolyLineM support in Catfood.Shapefile

I’ve just updated Catfood.Shapefile, my ESRI Shapefile parser for .NET, with PolyLineM support thanks to a contribution from Stephan Stapel. The solution for the new version has also been updated to Visual Studio 2010.

Download Catfood.Shapefile.dll 1.30 from CodePlex.

Catfood.Shapefile 1.40

I’ve just released a small update to Catfood.Shapefile. Stephan Stapel, who implemented PolyLineM support, has contributed a patch that improves the class hierarchy. CodePlex user originSH suggested supporting the ACE driver for 64-bit systems. I’ve added a constructor overload that allows you to use predefined Jet and ACE connection strings or provide your own templates if necessary. Thanks to Stephan and originSH.

Catfood.Shapefile is a .NET library for enumerating ESRI shapefiles. I originally wrote the library to help me build some complex layers in Catfood Earth. Since then it’s picked up thousands of users and some really valuable suggestions and patches from the CodePlex community. I’m very glad a took a couple of hours to open source the library back in 2009.

Catfood.Shapefile 1.50

I've just released a small update to my C# Shapefile library on Codeplex. Catfood.Shapefile 1.50 fixes a couple of bugs related to metadata and adds the ability to access metadata records directly via IDataRecord. 

Shapefile Update

A few people have asked for 3D shape support in my ESRI Shapefile library. I've never got around to it, but CodePlex user ekleiman has forked a version in his ESRI Shapefile to Image Convertor that supports PointZ, PolygonZ and PolyLineZ shapes. If that's what you need please check it out.

Catfood.Shapefile 1.60

I just released Catfood.Shapefile 1.60. This contains a fix from Libor Weigl that factors out the enumerator so that you can still access the shapefile after enumeration.

Catfood.Shapefile is a .NET library for parsing ESRI Shapefiles.

(previously)

Catfood.Shapefile 2.00

I just released Catfood.Shapefile 2.00, my .NET parser for ESRI Shapefiles.

The big change is that I have migrated to .NET Standard 2.0. This makes it possible to use from .NET Core as well as classic .NET Framework from 4.6.1 up. If you need to use an older version of .NET Framework then you'll want to stick with Catfood.Shapefile 1.60.

Catfood.Shapefile is now also available via NuGet. This is the recommended way to install. The source code is still available on GitHub.

Catfood.Shapefile 3.00

I just released Catfood.Shapefile 3.00 on NuGet and GitHub.

There is a breaking change with bounding boxes. The bounding box returned by the library has been broken since the first version. From 3.00 the correct bounding box is returned, but you can opt into the old behavior by passing BoundingBoxConvention.Legacy to the constructor.

DbfDataReader has replaced OleDb for accessing metadata. This will fix platform support issues for OleDb. It necessitated a move to .NET Standard 2.1, so use Shapefile 2.00 if you need .NET Standard 2.00.

I added support for missing shapes (M and Z variants mostly), and the library will now handle missing files so you can read shapes with just a .shp file if that's all you have.