import svg

edited April 2016 in Questions about Code

Hello

I'm trying to start a sketch using 2.0.1 on Windows. The base map is of LA and eventually I'll be plotting points across the image based on longitude and latitude. Pretty basic. However, I'm stuck on the importing the svg! The svg is one I saved from wikipedia: https://commons.wikimedia.org/wiki/File:USA_Los_Angeles_Metropolitan_Area_location_map.svg and retitled LAMetro.svg. The file is saved on mydesktop under W6 Sketch and in it is the svg, the pde and the csv I will be using. Is this a code problem? Is there something I'm missing? Any help is much appreciated :)

// LIBRARIES
import processing.pdf.*;

// GLOBAL VAIRABLES
PShape baseMap;

// SETUP
void setup() {
  size(800, 842);
  baseMap =  loadShape("LAMetro.svg ");

}

// DRAW
void draw() {
  shape(baseMap, 0, 0, width, height);

}
Tagged:

Answers

  • edited April 2016

    Drag & drop your file into the PDE, so it is copied to subfolder "data/".

  • or by using 'Add File' under the 'Sketch' menu...

Sign In or Register to comment.