Convert a shapefile (.shp) to xml/json

What dassouki said. Get GDAL from http://www.kyngchaos.com/software:frameworks. Use it to convert a shapefile to GeoJSON like this: $ ogr2ogr -f “GeoJSON” output.json input.shp eg $ ogr2ogr -f “GeoJSON” /tmp/world.json world_borders.shp world_borders $ cat /tmp/world.json { “type”: “FeatureCollection”, “features”: [ { “type”: “Feature”, “properties”: { “CAT”: 1.000000, “FIPS_CNTRY”: “AA”, “CNTRY_NAME”: “Aruba”, “AREA”: 193.000000, “POP_CNTRY”: 71218.000000 }, … Read more

Tools to help reverse engineer binary file formats

Here are some tips that come to mind: From my experience, interactive scripting languages (I use Python) can be a great help. You can write a simple framework to deal with binary streams and some simple algorithms. Then you can write scripts that will take your binary and check various things. For example: Do some … Read more

Write a file in UTF-8 using FileWriter (Java)?

Safe Encoding Constructors Getting Java to properly notify you of encoding errors is tricky. You must use the most verbose and, alas, the least used of the four alternate contructors for each of InputStreamReader and OutputStreamWriter to receive a proper exception on an encoding glitch. For file I/O, always make sure to always use as … Read more

What is the difference between “JPG” / “JPEG” / “PNG” / “BMP” / “GIF” / “TIFF” Image?

Yes. They are different file formats (and their file extensions). Wikipedia entries for each of the formats will give you quite a bit of information: JPEG (or JPG, for the file extension; Joint Photographic Experts Group) PNG (Portable Network Graphics) BMP (Bitmap) GIF (Graphics Interchange Format) TIFF (or TIF, for the file extension; Tagged Image … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)