Skip to main content

Place


Find places

Get a list of places.

const response = await geocore.Place.placeList({
name: "name",
area: {
north: 1,
south: 2,
west: 3,
east: 4,
};
tags: ["string"],
createdRange: {
start: "2025-01-01",
end: "2025-01-01",
}
updatedRange: {
start: "2025-01-01",
end: "2025-01-01",
},
createdBy: ["string"],
groupIds: ["string"],
semanticSearchText: "string",
isPublic: true,
});

Parameters

nametypedata typedescription
nameoptionalstringSearch by place name
area[north]optionalnumberLongitude of north west point
area[south]optionalnumberLatitude of north west point
area[west]optionalnumberLongitude of north east point
area[east]optionalnumberLatitude of north east point
tagsoptionalarray<string>Search by place tags
createdRange[start]optionaldateSearch by createdAt timestamp
createdRange[end]optionaldateSearch by createdAt timestamp
updatedRange[start]optionaldateSearch by modifiedAt timestamp
updatedRange[end]optionaldateSearch by modifiedAt timestamp
createdByoptionalarray<string>Search by creator of places
groupIdsoptionalarray<string>Search by groups that places belong to
semanticSearchTextoptionalstringSearch place by semantic description
isPublicoptionalbooleanSearch place by public status
prefecturesoptionalarray<string>Search by prefecture of places
districtsoptionalarray<string>Search by districts of places
municipalitiesoptionalarray<string>Search by municipalities of places
pageoptionalnumberPage ordinal number, default is 1
limitoptionalnumberNumber of records per page, default is 20
Get a place

Get a place.

const response = await geocore.Place.getPlace(placeId);

Prerequisites

Successfully get the IdToken from login API.

Parameters

nametypedata typedescription
placeIdrequiredstringPlace ID
Create place

Create a new place.

// If you want to upload large video files, use the file upload API
const { data: { fileId, fileKey, parts }} = await geocore.File.generateMultipartUploadPresignedUrls({
fieldName: 'video',
fileName: 'fileName.mp4',
numberOfParts: 4,
});
// Upload using the presigned URLs in `parts` array...
// After uploading, call `completeMultipartUpload` API to get the uploaded file ID in Geocore system
const { data: { file: fileSave }} = await geocore.File.completeMultipartUpload({
fieldName: 'video',
fileKey,
fileId,
fileType: 'video/mp4',
parts: [{
PartNumber: 1,
ETag: 'string',
}]
});
const formData = new FormData();
formData.append('name', name);
formData.append('description', description);
formData.append('tags[]', tagIds);
formData.append('isPublic', isPublic);
formData.append('geometry[type]', 'Point');
formData.append('geometry[overlay][position][lng]', '12');
formData.append('geometry[overlay][position][lat]', '34');
formData.append('photo', photoFile);
formData.append('videos[]', fileSave._id);

const response = await geocore.Place.createPlace(formData);

Prerequisites

Successfully get the IdToken with user access level from login API.

Parameters

nametypedata typedescription
namerequiredstringPlace name
descriptionrequiredstringPlace description
tagsrequiredstringPlace tags
isPublicoptionalbooleanPlace public status, only available if logged in user is company admin
geometry[type]requiredstringLocation geometry type, can be marker, circle, rectangel or polygon
geometry[overlay][position][lng]requiredstringLongitude of place in string, required when geometry type is marker
geometry[overlay][position][lat]requiredstringLatitude of place in string, required when geometry type is marker
geometry[overlay][center][lng]requiredstringLongitude of circle place in string, required when geometry type is circle
geometry[overlay][center][lat]requiredstringLatitude of circle place in string, required when geometry type is circle
geometry[overlay][radius]requiredstringRadius of circle place in string, required when geometry type is circle
geometry[overlay][bounds][north]requiredstringNorth latitude of rectangle place in string, required when geometry type is rectangle
geometry[overlay][bounds][south]requiredstringSouth latitude of rectangle place in string, required when geometry type is rectangle
geometry[overlay][bounds][east]requiredstringEast longitude of rectangle place in string, required when geometry type is rectangle
geometry[overlay][bounds][west]requiredstringWest longitude of rectangle place in string, required when geometry type is rectangle
geometry[overlay][paths][idx][lng]requiredstringLongitude of the vertices in string, required when geometry type is polygon
geometry[overlay][paths][idx][lat]requiredstringLatitude of the vertices in string, required when geometry type is polygon
photooptionalbinaryPhoto files of place
videosoptionalarray<string>Video file IDs of place

Image notes

  • Maximum number of photos allowed is 10.
  • Maximum photo size: 20MB.
  • When uploading a place photo, that photo will be resized in 2 sizes: small (width 300px) and medium (width 1200px).
  • These resized images path will be stored in the database.
  • Only photos with width larger than these sizes will be resized.
Update place

Update a place.

const formData = new FormData();
formData.append('name', name);
formData.append('description', description);
formData.append('tags[]', tagIds);
formData.append('location[type]', 'Point');
formData.append('location[coordinates]', 12);
formData.append('location[coordinates]', 34);
formData.append('retainedPhotoIds[]', photoId);
formData.append('retainedVideoIds[]', videoId);
formData.append('photo', photoFile);
formData.append('videos[]', videoFileId);

if (isNewFile) {
formData.append('order[]', `${file?.uid}-${file?.name}`);
} else {
formData.append('order[]', file?.uid);
}

const response = await geocore.Place.updatePlace(placeId, formData);

Prerequisites

Successfully get the IdToken with user access level from login API.

Parameters

nametypedata typedescription
placeIdrequiredstringPlace ID
namerequiredstringPlace name
descriptionrequiredstringPlace description
tagsrequiredstringPlace tags
location[type]requiredstringValue must be "Point"
location[coordinates]requiredarray<number>Location of place
order[]optionalarray<string>Photo IDs order
retainedPhotoIds[]optionalarray<string>Photo IDs that user wants to keep
retainedVideoIds[]optionalarray<string>Video IDs that user wants to keep
photooptionalbinaryPhoto files of place
videosoptionalarray<string>Video file IDs of place
Delete place

Delete a place.

const response = await geocore.Place.deletePlace(placeId);

Prerequisites

Successfully get the IdToken with user access level from login API.

Parameters

nametypedata typedescription
placeIdrequiredstringPlace ID
Change publicity

Change public status of a place

const response = await geocore.Place.changePublicity(
placeId,
{
isPublic: true,
}
);

Prerequisites

Successfully get the IdToken with companyAdmin access level from login API.

Parameters

nametypedata typedescription
placeIdrequiredstringPlace ID
isPublicrequiredbooleanPublic status
Import places

Import places from a CSV file.

const formData = new FormData();
formData.append('csv', csvFile);

const response = await geocore.Place.import(formData);

Prerequisites

Successfully get the IdToken with companyAdmin access level from login API.

Parameters

nametypedata typedescription
csvrequiredstringCSV file with place information
Export places

Export places to a CSV file.

const response = await geocore.Place.export(query);

Prerequisites

Successfully get the IdToken with companyAdmin access level from login API.

Parameters

nametypedata typedescription
queryrequiredstringSame as get place query params