You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/README.md

139 lines
5.1 KiB

# CartoDB #
[CartoDB](http://www.cartodb.com) is a tool for analyzzing, vizzualising and sharing your geospatial data in PostGIS.
Each CartoDB is owned by its user, and is composed of:
13 years ago
- User Interface: create and manipulate tables and their data, import new ones, or export them to files
13 years ago
- PostGIS 2 database: a geospatial database with the full range of Postgres and PostGIS functionality
13 years ago
- Pure SQL API endpoint: run SQL queries and get responses in JSON, geojson and KML format
- Map tiler: A SQL configurable map tile generator for quick feedback on your data, allowing you to style and embed maps
- Authentication: Read/Write access to datasets over OAuth with user definable public access if required
13 years ago
Watch some [videos of CartoDB in action](http://www.vimeo.com/channels/cartodb) or try our hosted service, [www.cartodb.com](http://www.cartodb.com).
13 years ago
## Dependencies ##
13 years ago
- Mapnik 2.0
- PostGIS 2.0
- Postgres 9.1.x
13 years ago
- Redis 2.2+
- NodeJS 0.4.10+
- Ruby 1.9.2+
13 years ago
## Components of CartoDB ##
- Data analysis and management interface (this repository)
- Fully featured SQL API (https://github.com/Vizzuality/CartoDB-SQL-API)
- High speed map tile generator (https://github.com/Vizzuality/Windshaft-cartodb)
## Setting-up the environment for developers ##
- Install Ruby 1.9.2
- Install Node.JS and Npm, following these steps: <https://github.com/joyent/node/wiki/Installation> (alternatively you can use `brew instrall node``, but npm has to be installed following the wiki instructions`)
- Install PostgreSQL, PostGIS, GDAL, and Geo with postgis_template setup
- Install plpython for Python support in PostgreSQL (e.g., `sudo apt-get install postgresql-plpython-9.1`)
- Create a `template_postgis` database if one doesn't already exist:
13 years ago
#!/usr/bin/env bash
13 years ago
POSTGIS_SQL_PATH='pg_config --sharedir'/contrib/postgis-2.0
createdb -E UTF8 template_postgis
createlang -d template_postgis plpgsql
psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';"
psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql
psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql
psql -d template_postgis -f $POSTGIS_SQL_PATH/legacy.sql
psql -d template_postgis -f $POSTGIS_SQL_PATH/legacy_compatibility_layer.sql
13 years ago
psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
- Install Redis from <http://redis.io/download> or using `brew install redis`.
- Python dependencies:
easy_install pip # in MacOs X
pip install -r python_requirements.txt
Note: If compilation fails (it did for gdal module raising a Broken pipe error) try doing "export ARCHFLAGS='-arch i386 -arch x86_64'" first
- Setup new hosts in `/etc/hosts`:
# CartoDB
127.0.0.1 admin.localhost.lan admin.testhost.lan
127.0.0.1 my_subdomain.localhost.lan
# # # # #
13 years ago
- Clone the [Node SQL API](https://github.com/tokumine/cartodb-sql-api) in your projects folder:
git clone git@github.com:Vizzuality/CartoDB-SQL-API.git
13 years ago
- Install nodejs dependencies
npm install
- Clone the [map tiler](https://github.com/Vizzuality/Windshaft-cartodb) in your projects folder:
git clone git@github.com:Vizzuality/Windshaft-cartodb.git
- Install nodejs dependencies
npm install
13 years ago
- Clone the CartoDB repository in your projects folder:
git clone git@github.com:Vizzuality/cartodb.git
13 years ago
- Change to cartodb/ folder and `rvm` will require to create a new gemset. Say **yes**. If not, you must create a `gemset` for Ruby 1.9.2:
rvm use 1.9.2@cartodb --create
- Run `bundle`:
bundle install --binstubs
- Run Redis:
cd /tmp
redis-server
13 years ago
- Run `rake cartodb:db:setup EMAIL=me@mail.com SUBDOMAIN=my_subdomain PASSWORD=my_pass ADMIN_PASSWORD=my_pass` in cartodb folder
- This will configure 2 users. The admin user (admin) and a user of your own. After spinning up all your processes (cartodb, sql api, tiler), you should be able to login.
13 years ago
### Every day usage ###
- Check if Redis is running, if not `cd /tmp; redis-server`
- Change to CartoDB directory
- Run `bin/rake db:reset` if you want to reset your data and load the database from `seeds.rb` file
- Run a Rails server in port 3000: `rails s`
13 years ago
- In a separate tab change to Node SQL API and Tiler directories and run node.js: `node app.js developement`
13 years ago
- Open your browser and go to `http://admin.localhost.lan:3000` or `http://my_subdomain.localhost.lan:3000`_
13 years ago
- Enjoy!
13 years ago
### Contributors ###
13 years ago
- Fernando Blat (@ferblape)
- Javier Alvarez (@xavijam)
- Simon Tokumine (@tokumine)
- Javier Álvarez Medina (@xavijam)
- Alvaro Bautista (@batu)
- Fernando Espinosa (@ferdev)
- saleiva (@saleiva)
- Javier de la Torre (@jatorre)
- Andrew W Hill (@andrewxhill)
- Javier Arce (@javierarce)
- Aaron Steele (@eightysteele)