Question: I need to rapidly determine if a spatial polygon and a spatial line intersect. I am currently converting the polgon to a spatial line and using `gIntersection()`. Can anyone suggest a potentially quicker method? Perhaps using rasters instead of spatial line or something. I need to do this many thousands of times.

```
# .shp file to Spatial Line
polygon1 <- readShapeSpatial("C:.../SALandmass.shp")
polygon1filled <- SpatialPolygons(list(Polygons(list(polygon1@polygons[[1]]@Polygons[[1]]),ID=1)))
SL <- as(polygon1filled, "SpatialLines")

# Test if line between two coordinates cross the shape
Pt1 = list(x = c(CurrentLong, MapCoordsm$x[i]), y = c(CurrentLat, MapCoordsm$y[i]))
SpatialLine1 = SpatialLines(list(Lines(Line(cbind(Pt1$x,Pt1$y)), "L1")))
cross <- length(gIntersection(SpatialLine1, SL))

```

Answer: 
FormData has a `get` method you should use:

```
$(document).ready(function() {
    $('#submitIt').click(function() {
        var d = new FormData($('form')[0]);        
        alert(d.get('name'));
    });
});

```

read more in MDN: <https://developer.mozilla.org/en-US/docs/Web/API/FormData/get>
rather than making an `FormData` object you can access elements within an form like the code below shows :) 

```
$(document).ready(function() {
  $('#submitIt').click(function() {
    var d = $('form').toArray();        
    alert(d[0].name);
  });
});

```