Geotagging posts in BlogEngine.NET
I've written an extension for BlogEngine.NET that automatically adds several different geographical tags to blog posts. I knocked this up for my Hikes blog. It might be useful for any blog where some of the posts are related to a real world location.
To get started download GeotagFromKML.zip (2.24 kb) and copy GeotagFromKML.cs to the App_Code\Extensions folder in your BlogEngine.NET instance.
The extension does two things. Firstly it looks for a link to a KML file when post is added or updated (it does this because each of my hike posts includes a Google Earth KML file for the hike). If a KML link is found then a paragraph is added to the post containing the longitude and latitude of the first coordinate in the KML file. The paragraph uses the Geo microformat. You can customize the text in settings for the extension. You can also regenerate by deleting the paragraph and saving the post.
The second function is to add ICBM and Geo Tag META tags when serving a post that contains the geotagged coordinates. You can take advantage of this without linking to a KML file, just include a location like this in your post:
Once you have geotagging up and running you might also want to add GeoURL to the list of ping services for your site.
Related Posts
- About Hikes
- Migrating from Blogger to BlogEngine.NET
- BlogEngine.NET most popular pages widget using Google Analytics
- The curious case of the missing slugs (in BlogEngine.net 2.8)
- Moon on a Wire
(Published to the Fediverse as: Geotagging posts in BlogEngine.NET #code #blogengine.net #.net #c# #metadata #kml #geo #icbm #geourl #geotag A customer extension that supports geotagging posts in BlogEngine.NET. )
Add Comment
All comments are moderated. Your email address is used to display a Gravatar and optionally for notification of new comments and to sign up for the newsletter.