Search This Blog

Thursday, November 17, 2016

Batch loading OS Highway GML files to a PostgreSQL (+PostGIS) database

With one line at the Command Prompt (Windows) you can load a whole directory of files into a PostgreSQL database



D:\gisdata> for /R %f in (*.gml) do ogr2ogr -f "PostgreSQL" PG:"host=1.2.3.4 port=5432 user=postgres dbname=db password=pass123" %f -append


This will append the converted GML files into PostGIS format in the DB

Tuesday, November 1, 2016

Writing an ISO image to USB on Mac OSX

First up find which disk the USB is using:


diskutil list


then you will see a list of devices like this

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage Macintosh HD            499.4 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           +499.0 GB   disk1
                                 Logical Volume on disk0s2
                                 Unencrypted
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *15.6 GB    disk3
   1:             Windows_FAT_32 KINGSTON                15.6 GB    disk3s1


(eg if I wished to target the KINGSTON 16GB USB drive then it'd be /dev/disk3)


diskutil unmountdisk /dev/diskN


then


sudo dd if=/data/yourfile.iso of=/dev/diskN bs=1m


(wait)


should be done!

Friday, October 7, 2016

Concept Net

Some great work on common sense graphs...

https://github.com/commonsense/conceptnet5/wiki

http://conceptnet5.media.mit.edu/


Example:


*Something you find at the park is grass
*Something you find in a park is a frisbee
*Something you find at a park is a slide
*Something you find at a park is a human
*Something you find at the park is a flower
*Something you find in a park is a playground
You are likely to find a dog in a park
*Something you find at a park is a squirrel
*Something you find at the park is birds
*Something you find in a park is a picnic table
*Something you find in a park is animals
*Something you find in a park is a pigeon
*Something you find at the park is pond

Wednesday, September 7, 2016

LINKS to things to check out one day

Links to things I really should find time to check out :

http://mapsurfernet.com/demo/gallery

MapSurfer.NET is a free, modern and advanced framework for producing a cartographic product of a high quality. This full featured framework offers a rich set of tools and techniques to automate various cartographic tasks. MapSurfer.NET is designed to be fast and flexible for being used both in desktop and web applications.

-------

http://openrouteservice.org/
Open least cost paths (car, public transport, walking etc)

------

https://datahub.io/dataset/open-flights
(Flight data, and airport details)


Monday, August 22, 2016

SSL HTTPS on IIS - https://letsencrypt.org/

Google Chrome now blocks access to HTML5 geoocation stuff I need... unless it comes form HTTPS secure server.  Here are a few notes - mainly for Windows IIS.


1) SSL is really for 2 things (a) encryption (b) authentication of your server    - self-signed certificates are fine for (a) but not (b)

IIS - self certificates are really easy to generate and use on HTTPS site but you will get msg about not being trusted as (b) above

2) There's a relatively new Cert authority trying to make HTTPS free   --- https://letsencrypt.org/ 
they seem to have been set up April 2016

You can download a file and put on server to authenticate you are who you say you are...  without FTP you can still do this manually but need to create a file path on your Web server which has folder .well-known    which Windows doesn't like but you can make it do it by doing this:

 .well-known. (the last dot is important), Windows will create the folder and automatically will remove the last dot.

The certificate can then be downloaded and installed on IIS... you need to import the Cert  in  Microsoft Management console if on Windows.. then Complete the certificate import in IIS.

ALT to 2) Instead of going the time consuming pain of (2) then this makes life a lot lot easier.. (Windows)


Run the letsencrypt.exe on your server.. answer the prompts.. it does the authentication using letsencrypt.org and installs the certificate for you on IIS

Job done...  :-)

Monday, June 13, 2016

IMU - complementary filter

Some links on complementary filters for IMU

http://blog.bitify.co.uk/2013/11/using-complementary-filter-to-combine.html





http://www.geekmomprojects.com/mpu-6050-dmp-data-from-i2cdevlib/


http://stackoverflow.com/questions/32228629/imu-orientation-constantly-changing/32231388#32231388


Thursday, April 7, 2016

Getting I2C to work on Rapsberry Pi

Recently been trying to get an I2C sensor to work on a Raspberry Pi.. found these articles very useful.

Two parts

Part 1) Turn on in BIOS

http://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/

sudo raspi-config


In the advanced settings turn on I2C

Now complete the following steps :
  • Select “8 Advanced Options”
  • Select “A7 I2C”
  • Select “Yes”
The screen will ask if you want the interface to be enabled :
  • Select “Yes”
  • Select “Ok”
The screen will ask if you want the module to be loaded by default :
  • Select “Yes”
The screen will state the module will be loaded by default :
  • Select “Ok”
  • Select “Finish” to return to the command line
When you next reboot the I2C module will be loaded.

_______


Part TWO  - setup software

https://www.raspberrypi.org/forums/viewtopic.php?t=74763


Add this to /etc/modules and reboot

i2c-bcm2708
i2c-dev



sudo apt-get install python-smbus
sudo apt-get install i2c-tools



sudo i2cdetect -y 1