Skip to content

Commit

Permalink
Finish URL
Browse files Browse the repository at this point in the history
- Updated to actual finish URL
- Updated Readme file
- More accurate rounding
  • Loading branch information
james2432 committed Aug 19, 2016
1 parent 28846be commit 3844377
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
14 changes: 9 additions & 5 deletions OSVUploadr/src/main/java/ca/osmcanada/osvuploadr/JPMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class JPMain extends javax.swing.JPanel {
private final String URL_SEQUENCE = "http://openstreetview.com/1.0/sequence/";
private final String URL_PHOTO = "http://openstreetview.com/1.0/photo/";
private final String URL_FINISH = "http://openstreetview.com/1.0/sequence/finished-uploading/";
private String last_dir ="";

UploadManager um;
/**
Expand Down Expand Up @@ -132,7 +133,7 @@ private void SendFinished(long Sequence_id, String user_id)
{
try
{
URL url = new URL(URL_SEQUENCE);
URL url = new URL(URL_FINISH);
URLConnection con = url.openConnection();
HttpURLConnection http = (HttpURLConnection)con;
http.setRequestMethod("POST"); // PUT is another valid option
Expand Down Expand Up @@ -182,7 +183,7 @@ private long getSequence(ImageProperties imp, String user_id, String user_name)
http.setRequestMethod("POST"); // PUT is another valid option
http.setDoOutput(true);

DecimalFormat df = new DecimalFormat("#.######");
DecimalFormat df = new DecimalFormat("#.##############");
df.setRoundingMode(RoundingMode.CEILING);

Map<String,String> arguments = new HashMap<>();
Expand Down Expand Up @@ -541,12 +542,15 @@ private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
JFileChooser fc = new JFileChooser();
//fc.setCurrentDirectory(new java.io.File(".")); // start at application current directory
if(!last_dir.isEmpty()){
fc.setCurrentDirectory(new java.io.File(last_dir)); // start at application current directory
}
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int returnVal = fc.showSaveDialog(this);
if(returnVal == JFileChooser.APPROVE_OPTION) {
File folder = fc.getSelectedFile();
listDir.add(folder.getPath());
last_dir=folder.getPath();
}
}//GEN-LAST:event_jButton1ActionPerformed

Expand Down Expand Up @@ -593,8 +597,8 @@ private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
for(String item:listDir.getItems()){
Process(item,usr.split(";")[0],usr.split(";")[1]);
}
/*um = new UploadManager(listDir.getItems());
um.start();*/
//um = new UploadManager(listDir.getItems());
//um.start();

}//GEN-LAST:event_jButton3ActionPerformed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public int getSequenceNumber(){
* @return a string combining latitude and longitude seperated by a comma
*/
public String getCoordinates(){
DecimalFormat df = new DecimalFormat("#.######");
DecimalFormat df = new DecimalFormat("#.##############");
df.setRoundingMode(RoundingMode.CEILING);
String coords = df.format(_lat)+","+df.format(_long);
return coords;
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# OSVUploadr
GUI Uploader for OpenStreetView in Java

An application that helps you upload photos from action cameras like gopro and garmin virb (for now) to OpenStreetView.

## How to use ##
To start the application you need the java runtime environment(JRE) version 1.8+. To launch it you can double click the *.jar* file. If that doesn't work, running it via the command line via *java -jar [jar file path]/OSVUploadr.jar* will.

![Mainscreen](https://cloud.githubusercontent.com/assets/498547/17795874/01a06620-658a-11e6-9b05-79c5236b1cee.PNG)

1. Click "**Add Folder**" to select the folder you want to upload (sequences must already be split into individual folders)
2. After you have added folders to the queue. Press the "**Upload**" button to start the upload process. ![Upload](https://cloud.githubusercontent.com/assets/498547/17796000/27775f74-658b-11e6-994f-fe9947123952.PNG)


## Known issues ##
- Upload process is not threaded, so the upload button will look frozen until it finishes the upload.
- If images aren't geotagged the application will probably crash
- Remove Duplicates does nothing (for now)
- Application is only for action cameras. I will eventually incorporate images/videos taken from the APP.
- No resume from last file. Currently reuploads from image 1. (Currently working on this)

0 comments on commit 3844377

Please sign in to comment.